安装TensorFlow2.x版本,发现报找不到DLL的错误怎么办?ImportError: DLL load failed while importing _pywrap_tensorflow_in

11 篇文章 0 订阅
4 篇文章 0 订阅

报错内容:

Traceback (most recent call last):
File “C:\Anaconda\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File “C:\Anaconda\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py”, line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File “C:\Anaconda\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py”, line 24, in swig_import_helper
_mod = imp.load_module(’_pywrap_tensorflow_internal’, fp, pathname, description)
File “C:\Anaconda\lib\imp.py”, line 242, in load_module
return load_dynamic(name, filename, file)
File “C:\Anaconda\lib\imp.py”, line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: 找不到指定的模块。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:/Users/Administrator/Desktop/123.py”, line 5, in
import tensorflow as tf
File “C:\Anaconda\lib\site-packages\tensorflow_init_.py”, line 41, in
from tensorflow.python.tools import module_util as module_util
File "C:\Anaconda\lib\site-packages\tensorflow\python_init
.py", line 50, in
from tensorflow.python import pywrap_tensorflow
File “C:\Anaconda\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 69, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File “C:\Anaconda\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File “C:\Anaconda\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py”, line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File “C:\Anaconda\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py”, line 24, in swig_import_helper
_mod = imp.load_module(’_pywrap_tensorflow_internal’, fp, pathname, description)
File “C:\Anaconda\lib\imp.py”, line 242, in load_module
return load_dynamic(name, filename, file)
File “C:\Anaconda\lib\imp.py”, line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed while importing _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.

Process finished with exit code 1

解决办法:

这是电脑缺少Visual C++导致的,去这里下载:Visual C++下载网站
可能需要翻墙才能打开,如果是打不开,点击下方直接下载对应版本即可:
点击下载64位的Visual C++
点击下载32位的Visual C++
点击下载Linux的Visual C++
安装完成,再运行代码,会发现代码不再报这个错误了!

如果文章解决您多年未解之谜,请一键三连!

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

DK数据工作室

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值