ImportError:没有名为 tensorflow 的模块

新手上路,请多包涵

请帮我解决这个错误

我已经在我的服务器上安装了 tensorflow 模块,下面是它的信息

15IT60R19@cpusrv-gpu-109:~$ pip show tensorflow
Name: tensorflow
Version: 1.0.0
Summary: TensorFlow helps the tensors flow
Home-page: http://tensorflow.org/
Author: Google Inc.
Author-email: opensource@google.com
License: Apache 2.0
Location: /home/other/15IT60R19/anaconda2/lib/python2.7/site-packages
Requires: mock, numpy, protobuf, wheel, six

但是当我尝试导入 tensorflow 时,出现以下错误

>>> import tensorflow as tf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named tensorflow

我的python版本如下

Python 2.7.12 |Anaconda 2.5.0 (64-bit)| (default, Jul  2 2016, 17:42:40)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org

我已经尝试过 sol1 中给出的解决方案

溶胶2

我没有对服务器的 sudo 访问权限 我只能使用 pip 安装任何模块

原文由 Abhishek Gangwar 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 383
1 个回答

尝试使用您想要的任何版本和选项 –ignore-installed 再次安装 tensorflow,例如:

 pip install tensorflow==1.2.0 --ignore-installed

我使用此命令解决了同样的问题。

原文由 Dharma 发布,翻译遵循 CC BY-SA 3.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题