无法导入张量流

时间:2016-04-27 11:38:40

标签: python-2.7 ubuntu tensorflow tensorboard

我已经使用pip成功安装了tensorflow。我有python 2.7.11。要仔细检查 pip show tensorflow ,它会显示已成功安装tensorflow 0.8.0版本。

但要测试我做的安装

$python
import tensorflow as tf

然后我得到了

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

当我 $ pip show tensorflow 时,我得到了这个

Metadata-Version: 2.0
Name: tensorflow
Version: 0.8.0
Summary: TensorFlow helps the tensors flow
Home-page: http://tensorflow.org/
Author: Google Inc.
Author-email: opensource@google.com
Installer: pip
License: Apache 2.0
Location: /usr/local/lib/python2.7/dist-packages
Requires: six, protobuf, wheel, numpy
Classifiers:
Development Status :: 4 - Beta
Intended Audience :: Developers
Intended Audience :: Education
Intended Audience :: Science/Research
License :: OSI Approved :: Apache Software License
Programming Language :: Python :: 2.7
Topic :: Scientific/Engineering :: Mathematics
Topic :: Software Development :: Libraries :: Python Modules
Topic :: Software Development :: Libraries
Entry-points:
[console_scripts]
tensorboard = tensorflow.tensorboard.tensorboard:main

1 个答案:

答案 0 :(得分:0)

你确定当你调用python interpreter 2.7版是默认的吗? 尝试输入你的shell

python -V

验证哪个版本是默认版本。如果不是2.7,请尝试输入

python2.7 -c "import tensorflow as tf"

并查看是否有任何错误