1.配置清华镜像
在Anaconda Prompt中运行:
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.安装TensorFlow
conda create -n -tf2 tensorflow
查看是否安装成功
conda env list
如下显示为成功
激活tf2环境
conda activate tf2
安装tf2环境下的ipython
pip install ipython
打开IPython,import TensorFlow
ipython
import tensorflow as tf
不报错即为安装正确
注:如何看python目前安装路径
where python