0

我已经使用 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
4

1 回答 1

0

你确定当你调用 python 解释器版本 2.7 是默认的吗?尝试在你的 shell 中输入

python -V

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

python2.7 -c "import tensorflow as tf"

看看你是否有任何错误

于 2016-04-27T17:07:06.263 回答