python 调用 tensorflow.dll_python tensorflow导入DLL加载失败

在Windows 7 64位系统中,用户尝试使用Python 3.6.4导入TensorFlow时遇到DLL加载失败的问题,错误代码为-1073741795。已确认安装了Microsoft Visual C++ 2015 Redistributable(x64),但仍然无法解决。解决方案可能涉及到TensorFlow与系统的兼容性或其他依赖问题。
摘要由CSDN通过智能技术生成

我安装了最新的python 3.6.4 x64版本

然后使用pip3为cpu-only安装tensorflow

C:\>pip3 install tensorflow

但是当我尝试在python中导入tensorflow时

它向我显示了以下错误

我确信我已经安装了Microsoft Visual C 2015 Redistributable(x64)

所以它不会是dll msvcp140.dll丢失的问题

它说“DLL加载失败,错误代码为-1073741795”

那么究竟是什么问题呢

我找不到有关此错误代码的任何其他信息

我的操作系统:Windows 7企业版服务包1/64位/英特尔酷睿i5 M 540

>>> import tensorflow

Traceback (most recent call last):

File "C:\Users\Alan\AppData\Local\Programs\Python\Python36\lib\site-packages\t

ensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper

return importlib.import_module(mname)

File "C:\Users\Alan\AppData\Local\Programs\Python\Python36\lib\importlib\__ini

t__.py", line 126, in import_module

return _bootstrap._gcd_import(name[level:], package, level)

File "", line 994, in _gcd_import

File "", line 971, in _find_and_load

File "", line 955, in _find_and_load_unlocked

File "", line 658, in _load_unlocked

File "", line 571, in module_from_spec

File "", line 922, in create_module

File "", line 219, in _call_with_frames_removed

ImportError: DLL load failed with error code -1073741795

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "C:\Users\Alan\AppData\Local\Programs\Python\Python36\lib\site-packages\t

ensorflow\python\pywrap_tensorflow.py", line 58, in

from tensorflow.python.pywrap_tensorflow_internal import *

File "C:\Users\Alan\AppData\Local\Programs\Python\Python36\lib\site-packages\t

ensorflow\python\pywrap_tensorflow_internal.py", line 21, in

_pywrap_tensorflow_internal = swig_import_helper()

File "C:\Users\Alan\AppData\Local\Programs\Python\Python36\lib\site-packages\t

ensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper

return importlib.import_module('_pywrap_tensorflow_internal')

File "C:\Users\Alan\AppData\Local\Programs\Python\Python36\lib\importlib\__ini

t__.py", line 126, in import_module

return _bootstrap._gcd_import(name[level:], package, level)

ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "", line 1, in

File "C:\Users\Alan\AppData\Local\Programs\Python\Python36\lib\site-packages\t

ensorflow\__init__.py", line 24, in

from tensorflow.python import *

File "C:\Users\Alan\AppData\Local\Programs\Python\Python36\lib\site-packages\t

ensorflow\python\__init__.py", line 49, in

from tensorflow.python import pywrap_tensorflow

File "C:\Users\Alan\AppData\Local\Programs\Python\Python36\lib\site-packages\t

ensorflow\python\pywrap_tensorflow.py", line 74, in

raise ImportError(msg)

ImportError: Traceback (most recent call last):

File "C:\Users\Alan\AppData\Local\Programs\Python\Python36\lib\site-packages\t

ensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper

return importlib.import_module(mname)

File "C:\Users\Alan\AppData\Local\Programs\Python\Python36\lib\importlib\__ini

t__.py", line 126, in import_module

return _bootstrap._gcd_import(name[level:], package, level)

File "", line 994, in _gcd_import

File "", line 971, in _find_and_load

File "", line 955, in _find_and_load_unlocked

File "", line 658, in _load_unlocked

File "", line 571, in module_from_spec

File "", line 922, in create_module

File "", line 219, in _call_with_frames_removed

ImportError: DLL load failed with error code -1073741795

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "C:\Users\Alan\AppData\Local\Programs\Python\Python36\lib\site-packages\t

ensorflow\python\pywrap_tensorflow.py", line 58, in

from tensorflow.python.pywrap_tensorflow_internal import *

File "C:\Users\Alan\AppData\Local\Programs\Python\Python36\lib\site-packages\t

ensorflow\python\pywrap_tensorflow_internal.py", line 21, in

_pywrap_tensorflow_internal = swig_import_helper()

File "C:\Users\Alan\AppData\Local\Programs\Python\Python36\lib\site-packages\t

ensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper

return importlib.import_module('_pywrap_tensorflow_internal')

File "C:\Users\Alan\AppData\Local\Programs\Python\Python36\lib\importlib\__ini

t__.py", line 126, in import_module

return _bootstrap._gcd_import(name[level:], package, level)

ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'

Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_probl

ems

for some common reasons and solutions. Include the entire stack trace

above this error message when asking for help.

解决方法:

在win7 64bit(Intel Core 2 Duo Cpu T6670 2.2GHz)上,我遇到了与tensorflow1.6-CPU相同的问题

在我找到这个之后,它解决了我的问题.

希望这个.whl可以帮助你.

标签:python,tensorflow,dll

来源: https://codeday.me/bug/20190731/1587805.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值