实际上我已经通过使用
安装了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时也显示相同的错误
答案 0 :(得分:1)
使用
pip3 install tensorflow
pip安装到默认的python目录。 pip3安装到python3