在云平台上安装了python3.6.5,使用tensorflow时报错ImportError: No module named ‘tensorflow’。特此记录。
解决方法:
1.upgrade setuptools
使用命令:pip install --ignore-installed setuptools
2.再次安装tensorfolw(根据个人情况选择)
cpu版本使用命令:pip install --ignore-installed --upgrade tensorflow
gpu版本使用命令:pip install --ignore-installed --upgrade tensorflow-gpu
3.测试
(1)tensorflow 1.0版本
import tensorflow as tf
hello=tf.constant("tf 666")
sess = tf.Session()
print(sess.run(h