导入tensorflow.出现importError: DLL load failed: 找不到指定的模块。python3.7
Posted sereasuesue
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了导入tensorflow.出现importError: DLL load failed: 找不到指定的模块。python3.7相关的知识,希望对你有一定的参考价值。
重点看你安装的哦版本。不同版本会有不同,错误一样,版本不一样解决方案会有差别 真的是困难重重
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
以上是关于导入tensorflow.出现importError: DLL load failed: 找不到指定的模块。python3.7的主要内容,如果未能解决你的问题,请参考以下文章
导入错误和未定义符号:dgesv_ 使用 PIP 安装 CVXPY 时出错
导入tensorflow.出现importError: DLL load failed: 找不到指定的模块。python3.7