tensorflow导入报错ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'

时间:2022-08-29 22:57:51

全部报错

Traceback (most recent call last):
  File "C:\。。。。\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 41, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\。。。。。\Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\。。。。。Python\Python36\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
    return importlib.import_module('_pywrap_tensorflow_internal')
  File "C:\。。。。。。。\Python\Python36\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'


swig是一个python到c/c++的依赖包,该错误应该是缺少依赖,看网上说window安装tensoflow需要Visual C++ 2015 redistributable

直接安装Visio studio后可以正常使用了。。。