TensorFlow安装成功,但是无法导入TensorFlow,出现ImportError: No module named tensorflow错误!
来源:3-11 安装TensorFLow(下)
游客110
2018-03-22
环境:centos7 + python2.7
python版本:
[fyp@localhost ~]$ python -V
Python 2.7.14
使用pip查看:
[fyp@localhost ~]$ pip show tensorflow
Name: tensorflow
Version: 1.6.0
Summary: TensorFlow helps the tensors flow
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: opensource@google.com
License: Apache 2.0
Location: /usr/lib64/python2.7/site-packages
Requires: astor, protobuf, gast, tensorboard, six, wheel, absl-py, backports.weakref, termcolor, enum34, numpy, grpcio, mock
Python命令行:
[fyp@localhost ~]$ python
Python 2.7.14 (default, Mar 21 2018, 18:32:19)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named tensorflow
1回答
-
游客110
提问者
2018-03-22
我重装了一个虚拟机(centos7),没有升级python(默认2.7.5),就能安装和引用成功。可能是python查找路径的问题。
00
相似问题