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)

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

  1. python——报错ImportError:DLL load failed with error code -1073741795的解决方式

    python中导入一个包,import cv2总是报错'ImportError:DLL load failed with error code -1073741795',报错形式: 网上找了好久的解决 ...

  2. 转载:Win7系统 利用 pycharm导入Tensorflow失败,出现报错——ImportError:DLL load failed with error code -1073741795的解决方式

    转载自:https://blog.csdn.net/shen123me/article/details/80621103 下面的报错信息困扰了一天,网上的各种方法也都试过了,还是失败,最后自己瞎试,把 ...

  3. from _sqlite3 import * ImportError: DLL load failed: 找不到指定的模块。

    *Error creating Django application: Error on python side. Exit code: 1, err: Traceback (most recent ...

  4. kivy sdl2 - ImportError: DLL load failed: 找不到指定的模块

    from kivy.app import App from kivy.uix.button import Button class TestApp(App): def build(self): ret ...

  5. psycopg2 ImportError: DLL load failed

    setup.py install 报错  error: command 'mt.exe' failed: No such file or directory  或者 Unable to find vc ...

  6. python中导入sklearn中模块提示ImportError: DLL load failed: 找不到指定的程序。

    python版本:3.7 平台:windows 10 集成环境:Anaconda3.7 64位 在jupyter notebook中导入sklearn的相关模块提示ImportError: DLL l ...

  7. 关于在PyCharm中import numpy 出现from . import _mklinit ImportError: DLL load failed: 找不到指定模块

    最近因为一些原因安装了Anaconda3并且重新配置Python环境,但是遇到了一些麻烦的事情. 首先就是在Anaconda已经装好numpy和mkl的情况下,在PyCharm中import nump ...

  8. Python报错 ImportError: DLL load failed while importing win32api: %1 不是有效的 Win32 应用程序 的解决方法

    今天在用jupyter notebook 的时候发生了kernel error,点开之后提示了以下报错信息 Traceback (most recent call last): File " ...

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

    导入的时候报出了 ImportError 在windows上安装python 的模块后,导入模块时报 python ImportError: DLL load failed: %1 不是有效的 Win ...

随机推荐

  1. 使用 FRP 让部门同事都能直接远程桌面办公( 适用于 TEAM 和向日葵卡顿的用户)

    背景说明 这两天由于疫情的原因,很多公司都得在家远程上班,然后像我们这类小公司有没有 VPN 这些东西.传统的远程回公司只能依靠 Teamviewer 或者向日葵等工具.但是由于最近用户量很多,可能会 ...

  2. Codeforces_733_D

    http://codeforces.com/problemset/problem/733/D 先给边排序,然后按3条边排序,只要判断相邻是否能组成长方体. #include<iostream&g ...

  3. Android Studio MainActivity中的R为红色

    csdn解决链接 https://blog.csdn.net/M283592338/article/details/79880413

  4. re模块 findall()详解

    1. findall() 函数的2种表示形式 import re kk = re.compile(r'\d+') kk.findall('one1two2three3four4') #[1,2,3,4 ...

  5. Golang调用Dll案例

    Golang调用Dll案例 前言 在家办公已经两个多星期了,目前最大的困难就是网络很差.独自一个人用golang开发调用dll的驱动程序.本来就是半桶水的我,还在为等待打开一个页面而磨平了耐心.本想依 ...

  6. 和内嵌的iframe进行通讯

    利用内置iframe进行通讯 1. 在当前网页设置iframe网页(监听iframe发来postmessage消息事件) a. 外部网页接收数据: 回调方法,其中e.data为传入数据: const ...

  7. React之拆分组件与组件之间的传值

    父子组件传值: 父组件向子组件传值通过向子组件TodoItem进行属性绑定(content={item}.index={index}),代码如下 getTodoItem () { return thi ...

  8. 《python可以这样学》第二章

    Python序列 列表与列表推导式 列表创建与删除 创建列表对象 >>> a_list = list((3, 5, 7, 9, 11)) >>> a_list = ...

  9. h5笔记1

    1.HTML中不支持 空格.回车.制表符,它们都会被解析成一个空白字符 2.适用于大多数 HTML 元素的属性: class 为html元素定义一个或多个类名(classname)(类名从样式文件引入 ...

  10. 【Python3爬虫】一次应对JS反调试的记录

    一.前言简介 在前面已经写过关于 JS 反调试的博客了,地址为:https://www.cnblogs.com/TM0831/p/12154815.html.但这次碰到的网站就不一样了,这个网站并不是 ...