1、安装Anaconda
最新版本的anaconda 默认3.7版本的python,但是tensorflow对3.6版本的python支持比较好,所以要先conda一个tensorflow环境。直接create这个环境会很慢,所以先改为清华镜像的conda
Anaconda 镜像使用帮助
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
2.添加镜像、创建虚拟环境并激活
输入conda create -n tensorflow python=3.6,会安装一个python3.6版本的名为tensorflow的虚拟环境。
接着activate tensorflow 进入tensorflow的环境
然后pip tensorflow,tensorflow官方是推荐直接pip的
pip install tensorflow==1.10.0
pip install tensorflow-gpu==1.10.0
直接改用清华镜像去pip pypi 镜像使用帮助
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow