简体   繁体   English

(Tensorflow流设置)ImportError:没有名为tensorflow的模块

[英](Tensorflow Flow Setup) ImportError: No module named tensorflow

I'm not able to complete the setup instructions through the Tensorflow documentation using pip3, Python 3.6, and mac Sierra v10.12.6. 我无法使用pip3,Python 3.6和mac Sierra v10.12.6通过Tensorflow文档来完成设置说明。

Attempting to validate the install results in the following: 尝试验证安装结果如下:

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

Notice that when you run python you get Python 2.7.10 which is not the version that you installed the TensorFlow library for. 请注意,当您运行python您会获得Python 2.7.10 ,这不是您为其安装TensorFlow库的版本。 Try running python3 or make sure you are running Python-3x before importing import tensorflow as tf . 尝试运行python3或在将import tensorflow as tf之前确保运行Python-3x。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM