Win10使用tensorflow出现ImportError: DLL load failed: 动态链接库(DLL)初始化例程失败

查原因:新版 tensorflow 安装包不支持较老的处理器,需要安装老版本的tensorflow。

pip install --ignore-installed --upgrade tensorflow==1.5

发现

ERROR: Could not find a version that satisfies the requirement tensorflow==1.5.0 (from versions: 1.13.0rc1, 1.13.0rc2, 1.13.1, 1.13.2, 1.14.0rc0, 1.14.0rc1, 1.14.0, 1.15.0rc0, 1.15.0rc1, 1.15.0rc2, 1.15.0rc3, 1.15.0, 1.15.2, 2.0.0a0, 2.0.0b0, 2.0.0b1, 2.0.0rc0, 2.0.0rc1, 2.0.0rc2, 2.0.0, 2.0.1, 2.1.0rc0, 2.1.0rc1, 2.1.0rc2, 2.1.0, 2.2.0rc0, 2.2.0rc1, 2.2.0rc2)

根据提示换成 1.15.0

 pip install tensorflow==1.15.0 -i https://pypi.tuna.tsinghua.edu.cn/simple

如果网络没问题,用清华镜像应该可以安装
还是不行。。。。。。
但是换成Anaconda安装就可以了

 pip install tensorflow==1.15.0 -i https://pypi.tuna.tsinghua.edu.cn/simple

在这里插入图片描述

tf.version
‘1.15.0’

https://blog.csdn.net/lchzh1994/article/details/81223726

如果还不行,比如:

ERROR: Cannot unpack file C:\Users\qishang\AppData\Local\Temp\pip-unpack-fwrwrq2r\simple (downloaded from C:\Users\qishang\AppData\Local\Temp\pip-req-build-pi5_wb40, content-type: text/html; charset=utf-8); cannot detect archive format
ERROR: Cannot determine archive format of C:\Users\qishang\AppData\Local\Temp\pip-req-build-pi5_wb40

再换个镜像,比如豆瓣镜像,在CMD下输入:

pip install -i http://pypi.douban.com/simple/ --trusted-host=pypi.douban.com/simple tensorflow==1.13.1

在这里插入图片描述
看似安装成功了,其实不然,在import tensorflow as tf之后会报 DLL加载失败,参考这篇博文
最后使用conda install tensorflow==1.13.1安装成功:

>>> tf.__version__
'1.13.1'

Conda命令行是行了,pycharm运行又报错

import tensorflow as tf
print(tf.__versino__)
-------------------------------------------------------------------------
Original error was: DLL load failed: 找不到指定的模块。

经排查,原来是Anaconda的环境变量没有添加
原来是Anaconda的环境变量没有添加
加上环境变量,就没问题了。

https://blog.csdn.net/qq_30336973/article/details/90676157

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值