ImportError: DLL load failed with error code -1073741795

Win7,python3.6,pip安装tensorflow之后报错:

>>> import tensorflow
Traceback (most recent call last):
  File "D:\AppSetPlace\python36\lib\site-packages\tensorflow\python\pywrap_tenso
rflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "D:\AppSetPlace\python36\lib\site-packages\tensorflow\python\pywrap_tenso
rflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "D:\AppSetPlace\python36\lib\site-packages\tensorflow\python\pywrap_tenso
rflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module(‘_pywrap_tensorflow_internal‘, fp, pathname, descript
ion)
  File "D:\AppSetPlace\python36\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "D:\AppSetPlace\python36\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed with error code -1073741795

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\AppSetPlace\python36\lib\site-packages\tensorflow\__init__.py", line
28, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-im
port
  File "D:\AppSetPlace\python36\lib\site-packages\tensorflow\python\__init__.py"
, line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "D:\AppSetPlace\python36\lib\site-packages\tensorflow\python\pywrap_tenso
rflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "D:\AppSetPlace\python36\lib\site-packages\tensorflow\python\pywrap_tenso
rflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "D:\AppSetPlace\python36\lib\site-packages\tensorflow\python\pywrap_tenso
rflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "D:\AppSetPlace\python36\lib\site-packages\tensorflow\python\pywrap_tenso
rflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module(‘_pywrap_tensorflow_internal‘, fp, pathname, descript
ion)
  File "D:\AppSetPlace\python36\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "D:\AppSetPlace\python36\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed with error code -1073741795

  

解决办法:

有人说(https://blog.csdn.net/fhqlongteng/article/details/80279197)是CPU太老了,我也不太懂CPU,但安装他说的办法:

问题的原因是我的电脑(联想V460)的cpu比较老,不支持AVX指令导致的,需要安装特殊编译的tensorflow 1.6.0版本才可以解决,注意安装时要先卸载先前安装的1.8.0版本。关于这个问题的详细解决过程可以参考github上面tensorflow的论坛

问题解决了。

安装上面说的版本之后还可能出现一个错误:

from google.protobuf.pyext import _message,使用tensorflow出现 ImportError: DLL load failed

按照这篇博客(https://blog.csdn.net/u012193416/article/details/86301899)说的方法解决了问题:

在自动安装了tensorflow时, protobuf安装的是最新版本3.6.1, 出现了不兼容的问题。

更换为 protobuf 3.6.0即可(pip install protobuf==3.6.0)

原文地址:https://www.cnblogs.com/144823836yj/p/11382056.html

时间: 2024-08-28 03:20:17

ImportError: DLL load failed with error code -1073741795的相关文章

psycopg2 ImportError: DLL load failed

setup.py install 报错  error: command 'mt.exe' failed: No such file or directory  或者 Unable to find vcvarsall.bat 于是 用 setup.py insall build --compiler=mingw32 担心没装 mingw32,但是喜悦地发现以前装 Ada 的 GNAT 的时候 bin 里面有mingw32 很多好东西, 而且已经在 path 中了,于是安装成功. 但是在 impor

ImportError: DLL load failed: 找不到指定的模块。

今年的软件杯中,我们比赛选题是关于深度学习的内容,在配置Pycharm里面引用电脑GPU时候出现“ImportError: DLL load failed: 找不到指定的模块.”的问题,我踩坑踩了很多,才找到的解决办法,分享一下: 首先说一下环境,我的配置是win10 + python3.6 + pycharm + tensorflow-gpu1.3 + CUDA8.0+cudnn-8.0-windows10-x64-v5.1 版本之间是有配置要求的,有的版本和版本之间是会出现问题的,所以在下载

ImportError: DLL load failed: %1 不是有效的 Win32 应用程序。

from matplotlib import pyplot as pltfrom sklearn.datasets import load_irisimport numpy as np data=load_iris()feature_names=data['featrue_names']target=data['target']for t.marker,c in zip(xrange(3),">ox","rgb"):    plt.scatter(featur

Python ImportError: DLL load failed: %1 不是有效的 Win32 应用程序。

问题怎么出现的: 电脑是win8 64位,,下载了一个mysqldb 32位,http://sourceforge.net/projects/mysql-python/files/latest/download.安装后import MySQLdb 就出现了如题错误. 看了一个帖子,如下: 在windows上安装python mysql模块后,导入模块时报 python ImportError: DLL load failed: %1 不是有效的 Win32 应用程序 这个是因为你安装了64位的p

python ImportError: DLL load failed: %1 不是有效的 Win32 应用程序

今天折腾pandas的时候, 很想当然的认为是64位的系统, 理所当然的就下载了一个64位的二进制安装包, 结果安装一切正常, 在导入的时候报出了 ImportError 在windows上安装python 的模块后,导入模块时报 python ImportError: DLL load failed: %1 不是有效的 Win32 应用程序 这个是因为你安装了64位的python,然后安装32位的模块,或者你安装了32位的python,然后安装64位的模块 先确定自己的python是是多少位

ImportError DLL load failed: %1 不是有效的 Win32 应用程序

操作系统:win7 64位,安装mysqldb 后提示:ImportError DLL load failed: %1 不是有效的 Win32 应用程序,是由于安装的32位的 MySQL-Python-1.2.3.win32-py2.exe,,只要改成64位版本的就可以了. 如果没有找到,可以使用如下链接下载: 32位:http://download.csdn.NET/detail/seven_zhao/6607621 64位:http://download.csdn.net/detail/se

from scipy import spatial 出现 from .qhull import * ImportError: DLL load failed: The specified module could not be found. 错误

错误描述: 本人机器window8.1 64位,python2.7. Traceback (most recent call last): File "C:/Users/Hamid/Documents/kodeyaro/kodefolani.py", line 41, in <module> from scipy.spatial import Delaunay File "C:\Python27\lib\site-packages\scipy\spatial\__

pywin32 ImportError: DLL load failed: 找不到指定的模块

操作系统信息: OS 名称:          Microsoft Windows 7 旗舰版 OS 版本:          6.1.7601 Service Pack 1 Build 76 系统类型:         x64-based PC python版本: Python 2.6.6 (r266:84297, Aug 24 2010, 18:13:38) [MSC v.1500 64 bit (AMD64)] on win32 使用pywin32-219.win-amd64-py2.6.

ImportError: DLL load failed: 找不到指定的模块

如果遇到错误:ImportError: DLL load failed: 找不到指定的模块出现错误原因:安装包的来源问题,也可以理解为包版本兼容问题,有的包使用官方出版,有的包使用whl文件安装 解决方案:将所有包都统一来源,要么全部使用官方出版的包,要么全部使用whl里面的包,问题就解决了 numpy+scipy+scikit-learn组件,使用whl文件安装下载: 下载地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/ 找到库对应的python版本