降低python至3.5
conda install python=3.5
创建一个tensorflow 虚拟环境:
conda create -n tensorflow python=3.5
激活tensorflow虚拟环境
activate tensorflow
安装tensorflow
pip install tensorflow -i https://pypi.tuna.tsinghua.edu.cn/simple (从国内镜像源下载,速度极快且稳定)
然后测试
python
import tensorflow as tf
message=tf.constant(‘welcome’)
with tf.Sesiion() as sess:
print(sess.run(message).decode())
运行成功,但是jupyter notebook打开后输入
import tensorflow as tf
运行报错,需要在激活TensorFlow之后安装ipython和jupyter
(tensorflow)D:>conda install ipython
・・・
(tensorflow)D:>conda install jupyter
・・・
接着安装nb_conda包库
(tensorflow)D:>conda install nb_conda
然后启动jupyter notebook
结果显示
就成功了
文章来源: https://blog.csdn.net/m0_37723350/article/details/90238732