导入tensorflow时,没有名为“ tensorflow.python.platform”的模块python shell上的tflearn

时间:2019-06-03 09:47:01

标签: python-3.x tensorflow

我正在Windows 10 pc上运行python 3.7 我在导入python项目中导入tensorflow或tflearn时遇到问题 每次运行后

import tflearn 
import tensorflow

我总是总是遇到相同的错误

    import tflearn
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\Python37\lib\site-packages\tflearn\__init__.py", line 4, in <module>
    from . import config
  File "C:\Program Files\Python37\lib\site-packages\tflearn\config.py", line 3, in <module>
    import tensorflow as tf
  File "C:\Users\genes\AppData\Roaming\Python\Python37\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "C:\Users\genes\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\genes\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\pywrap_tensorflow.py", line 25, in <module>
    from tensorflow.python.platform import self_check
ModuleNotFoundError: No module named 'tensorflow.python.platform'

关于如何同时解决tflearn && tensorflow导入的任何想法。

1 个答案:

答案 0 :(得分:2)

您可以尝试以下操作: pip安装tflearn

此后,请尝试再次导入tflearn