anaconda安装tensorflow
打开anaconda prompt,
创建虚拟环境:conda create -n tensorflow python=3.6 注意这个python版本,需要与tensorflow的版本做匹配
切换到这个环境:conda activate tensorflow
退出这个环境 conda deactivate
切换国内镜像源:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
安装tensorflow
conda install --channel https://conda.anaconda.org/anaconda tensorflow=1.14.0
我用pip安装一直报错,用conda安装就没问题
安装完
在Anaconda Prompt窗口中输入: python
进入python后输入:
import tensorflow as tf
sess = tf.Session()
a = tf.constant(10)
b= tf.constant(12)
sess.run(a+b)
退出python命令是exit()
不报错即安装成功
在这环境中安装jupyter
conda install jupyter
结束后就有 tensorflow 的编译环境了
浙公网安备 33010602011771号