1. 为TensorFlow2.0创建新的conda环境
conda create -n tensorflow-2.0 python=3.6
2. 激活这个环境
source activate tensorflow-2.0
3. 在这个环境中利用pip通过清华源安装TensorFlow
pip install tensorflow==2.0.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
4. 安装完毕以后,查看版本
import tensorflow as tf
tf.__version__
备注:官网安装教程 https://tensorflow.google.cn/install
conda常用命令:
1. conda list 查看conda安装了哪些包
2. conda env list 查看创建了哪些虚拟环境
3. conda update conda更新conda版本
4. conda create -n tensorflow-2.0 新建名为tensorflow-2.0的虚拟环境
5. conda activate tensorflow-2.0 激活虚拟环境tensorflow-2.0
6. conda deactivate tensorflow-2.0 关闭虚拟环境tensorflow-2.0
6. conda remove -n tensorflow-2.0 --all 删除名为tensorflow-2.0的虚拟环境
清华源不好使了,增加一个豆瓣云
python -m pip install tensorflow==2.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
python -m pip install openv-python==3.4.3.18 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com