【问题标题】:How to fix this error while importing tflearn library?导入 tflearn 库时如何解决此错误?
【发布时间】:2019-04-14 06:27:08
【问题描述】:

我正在导入 tflearn 库并收到此错误消息。我是新手,刚刚开始通过 tensorflow 学习。我在通过 pip 安装 tensorflow 时也遇到了问题,但是在网站上的一篇文章中使用解决方案后成功安装了

Traceback (most recent call last):
File "C:\Users\Welcome\AppData\Local\Programs\Python\Python36-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
  fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(__file__)])
File "C:\Users\Welcome\AppData\Local\Programs\Python\Python36-32\lib\imp.py", line 297, in find_module
  raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Welcome\AppData\Local\Programs\Python\Python36-32\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
  from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Welcome\AppData\Local\Programs\Python\Python36-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
  _pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Welcome\AppData\Local\Programs\Python\Python36-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
  import _pywrap_tensorflow_internal
ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
  import tflearn
File "C:\Users\Welcome\AppData\Local\Programs\Python\Python36-32\lib\site-packages\tflearn\__init__.py", line 4, in <module>
  from . import config
File "C:\Users\Welcome\AppData\Local\Programs\Python\Python36-32\lib\site-packages\tflearn\config.py", line 3, in <module>
  import tensorflow as tf
File "C:\Users\Welcome\AppData\Local\Programs\Python\Python36-32\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
  from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
File "C:\Users\Welcome\AppData\Local\Programs\Python\Python36-32\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
  from tensorflow.python import pywrap_tensorflow
File "C:\Users\Welcome\AppData\Local\Programs\Python\Python36-32\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
  raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\Welcome\AppData\Local\Programs\Python\Python36-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
  fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(__file__)])
File "C:\Users\Welcome\AppData\Local\Programs\Python\Python36-32\lib\imp.py", line 297, in find_module
  raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Welcome\AppData\Local\Programs\Python\Python36-32\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
  from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Welcome\AppData\Local\Programs\Python\Python36-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
  _pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Welcome\AppData\Local\Programs\Python\Python36-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
  import _pywrap_tensorflow_internal
ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'


Failed to load the native TensorFlow runtime.

【问题讨论】:

  • 您安装了tensorflow 吗?你为你的 Python 版本使用了代码吗? tflearn installation
  • 是的,我确实安装了 tensorflow
  • 最后一行错误可能意味着它找不到它。也许它不是 Python 3.6 32 位的版本。或者编译 C/C++ 代码可能有问题,并且磁盘上不存在库。

标签: python tensorflow neural-network deep-learning tflearn


【解决方案1】:

此错误的主要原因是没有下载 vs C++ 可再发行组件。

确保所有提到的software requirements 都已安装。

Windows 7 或更高版本(64 位) Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019

【讨论】:

    猜你喜欢
    • 2017-07-05
    • 1970-01-01
    • 2013-03-21
    • 1970-01-01
    • 1970-01-01
    • 2023-04-10
    • 2019-10-09
    • 2022-09-19
    • 1970-01-01
    相关资源
    最近更新 更多