转载:Win7系统 利用 pycharm导入Tensorflow失败,出现报错——ImportError:DLL load failed with error code -1073741795的解决方式
转载自:https://blog.csdn.net/shen123me/article/details/80621103
下面的报错信息困扰了一天,网上的各种方法也都试过了,还是失败,最后自己瞎试,把问题给解决了,希望能给遇到同样问题的人一个借鉴
具体报错信息如下:
Traceback (most recent call last):
File "C:\Users\Nhan\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\Nhan\AppData\Local\Programs\Python\Python35\lib\importlib_init_.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 958, in _find_and_load_unlocked
File "", line 666, in _load_unlocked
File "", line 577, in module_from_spec
File "", line 906, in create_module
File "", line 222, in _call_with_frames_removed
ImportError: DLL load failed with error code -1073741795
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Nhan\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Nhan\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Nhan\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
return importlib.import_module('pywrap_tensorflow_internal')
File "C:\Users\Nhan\AppData\Local\Programs\Python\Python35\lib\importlib_init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<pyshell#0>", line 1, in
import tensorflow
File "C:\Users\Nhan\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow_init_.py", line 24, in
from tensorflow.python import *
File "C:\Users\Nhan\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python_init_.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "C:\Users\Nhan\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "C:\Users\Nhan\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
return importlib.import_module(mname)
File "C:\Users\Nhan\AppData\Local\Programs\Python\Python35\lib\importlib_init_.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 958, in _find_and_load_unlocked
File "", line 666, in _load_unlocked
File "", line 577, in module_from_spec
File "", line 906, in create_module
File "", line 222, in _call_with_frames_removed
ImportError: DLL load failed with error code -1073741795
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Nhan\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\Nhan\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\Nhan\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
return importlib.import_module('pywrap_tensorflow_internal')
File "C:\Users\Nhan\AppData\Local\Programs\Python\Python35\lib\importlib_init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_pywrap_tensorflow_internal'
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/install_sources#common_installation_problems
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
——————————————————————————————————————————————————
解决办法:因为不知道我的电脑显卡支不支持Tensorflow-GPU,所以我只装了Tensorflow(CPU版本的)
出现上面那个问题的原因是CPU版本不支持安装的Tensorflow版本,我装Tensorflow的时候直接cmd命令窗口打开,pip install Tensorflow,系统默认安装的Tensorflow 1.8版本的(注意:安装Tensorflow之前默认已经全部安装Tensorflow依赖的其他包,比如scipy+mkl等等,具体可以百度)
具体操作:
在cmd命令窗口直接使用pip安装相关包的时候记得先提前把pip安装路径添加到系统环境变量,这样下面的步骤才可以顺利执行。
1、打开cmd命令窗口,先 pip uninstall tensorflow
2、接着 pip install Tensorflow==1.5
3、关掉pycharm,再重新打开pycharm项目程序
4、运行
至此,以上报错信息解决
转载:Win7系统 利用 pycharm导入Tensorflow失败,出现报错——ImportError:DLL load failed with error code -1073741795的解决方式的更多相关文章
- robotframework启动ride失败,提示wxpython ImportError: DLL load failed: 找不到指定的模块
背景:按照rf的操作,安装是没有问题,就是在启动ride.py 这个文件,就有问题了,提示 wxpython ImportError: DLL load failed: 找不到指定的模块 在pytho ...
- python中导入sklearn中模块提示ImportError: DLL load failed: 找不到指定的程序。
python版本:3.7 平台:windows 10 集成环境:Anaconda3.7 64位 在jupyter notebook中导入sklearn的相关模块提示ImportError: DLL l ...
- 【TensorFlow】:解决TensorFlow的ImportError: DLL load failed: 动态链接库(DLL)初始化例程失败
[背景] 在scikit-learn基础上系统结合数学和编程的角度学习了机器学习后(我的github:https://github.com/wwcom614/machine-learning),意犹未 ...
- 导入tensorflow.出现importError: DLL load failed: 找不到指定的模块。
导入tensorflow.出现importError: DLL load failed: 找不到指定的模块. 原因 这是由于windows上没有相应的动态链接库导致的,tensorflow依赖很多c+ ...
- 终于解决了python 3.x import cv2 “ImportError: DLL load failed: 找不到指定的模块” 及“pycharm关于cv2没有代码提示”的问题
终于解决了python 3.x import cv2 “ImportError: DLL load failed: 找不到指定的模块” 及“pycharm关于cv2没有代码提示”的问题 参考 :h ...
- AndroidStudio导入开源项目提示报错:Gradle sync failed: SSL peer shut down incorrectly
问题描述: AndroidStudio导入开源项目提示报错:Gradle sync failed: SSL peer shut down incorrectly (1 m 12 s 92 ms) 解决 ...
- 关于在PyCharm中import numpy 出现from . import _mklinit ImportError: DLL load failed: 找不到指定模块
最近因为一些原因安装了Anaconda3并且重新配置Python环境,但是遇到了一些麻烦的事情. 首先就是在Anaconda已经装好numpy和mkl的情况下,在PyCharm中import nump ...
- WIN7系统程序放在中文文件夹打开报错及界面汉字变乱码
今天发现在一个服务商提供的设备的WIN7系统里,一个稳定运行的程序打开时报错,且界面汉字变乱码. 经测试发现程序放在英文名称的文件夹中可以正常打开,但界面上的汉字仍为乱码. 后检查“控制面板“--”区 ...
- PyCharm导入pymysql包运行报错问题解决:No module named 'PyMySQL'
import pymysql # 导入包 # 报错问题显示: ImportError: No module named 'PyMySQL' 出现该问题提示:找不到该包名. 解决办法如下: ①先下载Py ...
随机推荐
- wc.exe程序
1.gitHub地址:https://github.com/loveYuJun/wc.exe.git 2.PSP表格 psp2.1 Personal Software Process Stages 预 ...
- CentOS 6.x/7.x上安装git
yum安装 # yum info git # yum install -y git 可以通过下面的命令来检查是否安装了git环境 git --version 参考:如何在CentOS 6.x/7.x上 ...
- Hello-Annie
Annie theme Annie是一个简单的Hexo博客主题,如果你喜欢散文.诗歌.小说......那么它可能合你心意! ☞预览-1,☞预览-2 Features 文艺.优雅.简洁的博客主题 页头随 ...
- 企业站做seo用什么程序好
http://www.wocaoseo.com/thread-306-1-1.html 随着互联网的兴起,越来越多的人通过网络来了解自已想了解的资讯,网络营销已经慢慢的取代了传统的营销模式.很多企业现 ...
- sourse insight总是代码一写长了,就自动换行
sourse insight总是代码一写长了,就自动换行. Document Options里面Word Wrap选项不勾选.
- Fitness - 05.06
倒计时239天 运动31分钟,共计10组,3.2公里.拉伸10分钟. 每组跑步1分钟(6.4KM/h),走路2分钟(5.8KM/h). 每组跑步1分钟的锻炼和上次比起来略显轻松,因此本次锻炼的目的主要 ...
- Ignatius and the Princess IV (水题)
"OK, you are not too bad, em... But you can never pass the next test." feng5166 says. &qu ...
- Spring JPA 定义查询方法
Spring JPA 定义查询方法 翻译:Defining Query Methods 存储库代理有两种方式基于方法名派生特定域的查询方式: 直接从方法名派生查询 自定义查询方式 可用选项基于 ...
- 浅谈HASH长度拓展攻击
前言 最近在做CTF题的时候遇到这个考点,想起来自己之前在做实验吧的入门CTF题的时候遇到过这个点,当时觉得难如看天书一般,现在回头望去,仔细琢磨一番感觉也不是那么难,这里就写篇文章记录一下自己的学习 ...
- vue 0点定时网络请求
export default { data() { return { timer: null, currentTime: '', zeroTime: '00:00:05', // zeroTime: ...