【发布时间】:2018-09-02 17:09:26
【问题描述】:
其实我已经通过使用安装了tensorflow
$ pip install tensorflow
当我使用它时效果很好
$ python
Python 2.7.15 (default, Jul 23 2018, 21:27:06)
[GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>import tensorflow
>>>
但是当我在命令行上使用 python3 时
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tensorflow'
>>>
它显示一个错误,当我使用 IDLE 时它显示相同的错误
【问题讨论】:
-
对于python3,做pip3 install tensorflow
-
pip3 install tensorflow -
好吧,看来我应该使用$ pip3 install tensorflow,但是我的pip3还有一个问题,让我先尝试解决这个问题......
-
尚不支持 Python 3.7,请查看此线程,[stackoverflow.com/questions/51337939/…
-
您可能在“pip3 install tensorflow”命令中遇到以下错误,“找不到满足要求 tensorflow 的版本(来自版本:)” - 同样不支持此版本的 Python
标签: python macos tensorflow