1.安装anaconda
2.载入清华镜像源(阿里源,中科院源也是一样的,这里的镜像源相当于是个缓存站,我们要下的东西,镜像源提前在谷歌里下载下来了,我们直接去镜像源下载,比访问谷歌更快)
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
3.创建tensorflow 的环境
conda create -n tensorflow python=3.6 #最好不要3.9好几个网友下3.9报错了
4.激活tensorflow
activate tensorflow
5.下载tensorflow
pip install tensorflow -i https://pypi.tuna.tsinghua.edu.cn/simple #用镜像来下,速度快
6.验证(注意下载好之后环境还tensorflow里,此时照搬网上的验证代码import tensorflow as tf 时错误的,应该先将shell切入python下面,再验证. 验证时输入如下代码,如果显示了版本,安装成功)
import tensorflow as tf
tf.__version__