(Tensorflow Flow Setup)ImportError:没有名为tensorflow的模块

时间:2018-05-17 17:39:19

标签: python python-3.x macos tensorflow

我无法使用pip3,Python 3.6和mac Sierra v10.12.6通过Tensorflow documentation完成设置说明。

尝试验证安装结果如下:

Installing collected packages: protobuf, tensorflow
Successfully installed protobuf-3.5.2.post1 tensorflow-1.8.0
You are using pip version 9.0.3, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

➜  python3.6 python
Python 2.7.10 (default, Feb  7 2017, 00:08:15)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named tensorflow
>>> import Tensorflow as tf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named Tensorflow
>>> import tensorflow-1.8.0 as tf
  File "<stdin>", line 1
    import tensorflow-1.8.0 as tf
                     ^
SyntaxError: invalid syntax

1 个答案:

答案 0 :(得分:0)

请注意,当您运行python时,您获得的Python 2.7.10不是您为TensorFlow库安装的版本。尝试运行python3或确保在导入import tensorflow as tf之前运行Python-3x。

相关问题