[英]Tensorflow won't import in my Python
I followed the tutorial on Tensorflow's web site, when I type Pip3 list
I can see Tensorflow 1.4 in the list but when I start the Python terminal I can't import it, it says that there is No module named 'tensorflow'
我遵循Tensorflow网站上的教程,当我输入
Pip3 list
我可以在列表中看到Tensorflow 1.4,但是当我启动Python终端时,我无法导入它,它说No module named 'tensorflow'
even when I type Pip3 show tensorflow
I can notice that it exists 即使当我输入
Pip3 show tensorflow
我也可以注意到它存在
You have two versions of Python 3 installed simultaneously. 您同时安装了两个版本的Python 3。
pip3
installed the package to Python 3.5, but python3
opens a Python 3.6 session, where tensorflow is not among the installed packages. pip3
将软件包安装到了Python 3.5,但是python3
打开了Python 3.6会话,其中tensorflow不在已安装的软件包中。
In other words, the reason for your problem is a mismatch between the pip3
version and python3
version. 换句话说,出现问题的原因是
pip3
版本和python3
版本之间不匹配。
This question adresses how to change this conflict. 这个问题解决了如何改变这种冲突。 You can either modify the
$PATH
variable such that python3
also points to Python 3.5, or uninstall one of the two python versions. 您可以修改
$PATH
变量,使python3
也指向Python 3.5,也可以卸载两个python版本之一。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.