导入tensorflow.出现importError: DLL load failed: 找不到指定的模块。python3.7(1)

重点看你安装的哦版本。不同版本会有不同,错误一样,版本不一样解决方案会有差别 真的是困难重重

C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\Scripts\python.exe E:/work/facode/renlian-master/face_train.py
Traceback (most recent call last):
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: 找不到指定的模块。

有的博客说

python 
import keras
出现 ImportError: No module named 'tensorflow.core'
输入

>>> pip install --upgrade tensorflow-gpu
>>> pip install --upgrade tensorflow
>>> pip install keras -U --pre
解决 ImportError: No module named 'tensorflow.core'

错误并没有解决

卸载重新安装

Traceback (most recent call last):
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\wei\.virtualenvs\pyqt51-EL5sW8oD\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: 找不到指定的模块。

导入但还是失败 

解决方案:
进入https://www.tensorflow.org/install/errors

安装2.1.0版本程序包需要msvcp140_1.dll文件,点击上图中的Microsoft VC++ downloads下载安装包并下载,即可成功导入Tensorflow。

下载地址:https://support.microsoft.com/zh-cn/help/2977003/the-latest-supported-visual-c-downloads

 

 

评论 16
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值