【问题标题】:Tensorflow no module named '_pywrap_tensorflow_internal' (DLL's appear to be fine)Tensorflow 没有名为“_pywrap_tensorflow_internal”的模块(DLL 似乎很好)
【发布时间】:2020-01-16 01:03:10
【问题描述】:

我不得不重新安装 python(这是一团糟,但据我所知,它似乎已经完全重新安装,没有任何残留),虽然我之前从未运行过它,但不幸的是,我最近想开始运行 TensorFlow,无论何时我尝试导入它引发错误的模块。我花了最后几天将所有可能的 Cuda 和 Cudnn dll 添加到我的路径以及我发现的所有其他解决方案,但它们都没有任何效果。 (我认为不相关的随机信息,但我放在这里以防万一:Pip 停止查找 TensorFlow,所以我在通过 pip 安装时使用了 google 链接,虽然我确实有最新的 python 3 我也有 python 2.7 ,如果我运行一个使用 python3 导入它的脚本,那么脚本就会结束并且没有错误,但是如果我使用传统的“python”命令(来自 cmd)运行它,则会引发以下错误) 操作系统:Windows 10

Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
Traceback (most recent call last):
  File "C:\Users\Paul Duke\AppData\Roaming\Python\Python38\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:\Program Files\Python38\lib\imp.py", line 296, 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\Paul Duke\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\Paul Duke\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\Paul Duke\AppData\Roaming\Python\Python38\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 "<stdin>", line 1, in <module>
  File "C:\Users\Paul Duke\AppData\Roaming\Python\Python38\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "C:\Users\Paul Duke\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\Paul Duke\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:\Users\Paul Duke\AppData\Roaming\Python\Python38\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:\Program Files\Python38\lib\imp.py", line 296, 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\Paul Duke\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\Paul Duke\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\Paul Duke\AppData\Roaming\Python\Python38\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.

See https://www.tensorflow.org/install/errors

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

【问题讨论】:

    标签: python tensorflow python-import importerror


    【解决方案1】:

    您使用的是 Python 3.8。

    从文件列表中 pypi for tensorflowpypi for tensorflow

    这里是tracking issue on github

    因此,只需使用旧版本的 python 即可解决您的问题。我建议你使用anaconda 或 miniconda 来管理你的深度学习开发环境。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-10-20
      • 2020-05-04
      • 2020-08-04
      • 1970-01-01
      • 2018-02-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多