Win10下安装Anaconda+安装Tensorflow
1.安装说明:试了好多方法都不能安装成功,也许我这里网太差了,偶尔看到下面方法,安装成功
安装Anaconda并建立tensorflow虚拟环境来安装tensorflow,避免环境之间的冲突。
2.安装tensorflow:打开 Anaconda Prompt
(1) 建立tensorflow Anaconda虚拟环境
(base) C:\Users\Dex>conda create --name tensorflow python=3.7 anaconda
查看已有的环境(当前已激活的环境会显示一个星号)
conda info -e
(3) 启动tensorflow Anaconda虚拟环境
(base) C:\Users\Dex>activate tensorflow
(tensorflow) C:\Users\Dex>conda
(tensorflow) C:\Users\Dex>pip
(tensorflow) C:\Users\Dex>python
(4) 安装tensorflow
(tensorflow) C:\Users\Dex>下执行命令:
pip install --index-url https://pypi.douban.com/simple tensorflow
(5) 验证:进入python环境
(tensorflow) C:\Users\Dex>python
>>> import tensorflow as tf
>>> print(tf.__version__)
2.1.0
(6) 关闭Pytorch Anaconda虚拟环境
(tensorflow) C:\Users\Dex>deactivate tensorflow
3.安装tensorflow-1.9:打开 Anaconda Prompt
(1) 建立tf19 Anaconda虚拟环境
(base) C:\Users\Dex>conda create --name tf19 python=3.7 anaconda
查看已有的环境(当前已激活的环境会显示一个星号)
conda info -e
(3) 启动tf19 Anaconda虚拟环境
(base) C:\Users\Dex>activate tf19
(tf19) C:\Users\Dex>conda
(tf19) C:\Users\Dex>pip
(tf19) C:\Users\Dex>python
(4) 安装tensorflow-1.9.0
下载路径:https://www.lfd.uci.edu/~gohlke/pythonlibs/#tensorflow
下载版本:tensorflow-1.9.0-cp37-cp37m-win_amd64.whl
文件路径: C:\Users\Dex\Downloads\
(tf19) C:\Users\Dex>下执行命令:
pip install --index-url https://pypi.douban.com/simple C:\Users\Dex\Downloads\tensorflow-1.9.0-cp37-cp37m-win_amd64.whl
(5) 验证:进入python环境
(tensorflow) C:\Users\Dex>python
>>> import tensorflow as tf
>>> print(tf.__version__)
1.9.0
(6) 关闭Pytorch Anaconda虚拟环境
(tf19) C:\Users\Dex>deactivate tf19