1.打开cmd,输入C:\Users\xy>conda create -n tensorflow python=3.7
这是在环境中创建了一个名为tensorflow的环境,具体会显示以下信息:
C:\Users\xy>conda create -n tensorflow python=3.7
Retrieving notices: ...working... done
Collecting package metadata (current_repodata.json): done
Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done==> WARNING: A newer version of conda exists. <==current version: 23.7.4latest version: 24.5.0Please update conda by running$ conda update -n base -c defaults condaOr to minimize the number of packages updated during conda update useconda install conda=24.5.0## Package Plan ##environment location: D:\Anaconda3\envs\tensorflowadded / updated specs:- python=3.7The following packages will be downloaded:package | build---------------------------|-----------------ca-certificates-2024.7.2 | haa95532_0 128 KB------------------------------------------------------------Total: 128 KBThe following NEW packages will be INSTALLED:ca-certificates pkgs/main/win-64::ca-certificates-2024.7.2-haa95532_0certifi pkgs/main/win-64::certifi-2022.12.7-py37haa95532_0openssl pkgs/main/win-64::openssl-1.1.1w-h2bbff1b_0pip pkgs/main/win-64::pip-22.3.1-py37haa95532_0python pkgs/main/win-64::python-3.7.16-h6244533_0setuptools pkgs/main/win-64::setuptools-65.6.3-py37haa95532_0sqlite pkgs/main/win-64::sqlite-3.45.3-h2bbff1b_0vc pkgs/main/win-64::vc-14.2-h2eaa2aa_4vs2015_runtime pkgs/main/win-64::vs2015_runtime-14.29.30133-h43f2093_4wheel pkgs/main/win-64::wheel-0.38.4-py37haa95532_0wincertstore pkgs/main/win-64::wincertstore-0.2-py37haa95532_2Proceed ([y]/n)? yDownloading and Extracting PackagesPreparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
# $ conda activate tensorflow
#
# To deactivate an active environment, use
#
# $ conda deactivate
出现下图信息则表示安装成功:
2.激活tensorflow环境,输入:activate tensorflow
3.安装TensorFlow,输入:pip install tensorflow
4.使用conda命令查看是否安装成功,输入:conda info --envs
5.在该环境下启动jupyter notebook【前提是之前已经在anaconda中成功安装了jupyter notebook】,输入:jupyter notebook