简体   繁体   English

导入 tflearn 库时如何修复此错误?

[英]How to fix this error while importing tflearn library?

I was importing the tflearn library and I'm getting this error message.我正在导入 tflearn 库,但收到此错误消息。 I'm new to this and just started to learn through tensorflow.我是新手,刚开始通过 tensorflow 学习。 I had problems installing tensorflow through pip as well but it successfully installed after using solution in one of the posts on website我在通过 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.

Main reason for this error is not having vs C++ redistributables dowloaded.此错误的主要原因是没有下载 vs C++ 可再发行组件。

Make sure all the software requirements mentioned are installed.确保安装了所有提到的软件要求

Windows 7 or later (64-bit) Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 Windows 7 或更高版本(64 位) Microsoft Visual C++ Redistributable for Visual Studio 2015、2017 和 2019

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

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