21

Python import matplotlib.pyplot importError: DLLload failed:找不到指定的模块【已...

 3 years ago
source link: http://blog.itblood.com/939.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

今天爱分享给大家带来 Python import matplotlib.pyplot importError: DLLload failed:找不到指定的模块【已解决】,希望能够帮助到大家。

Windows环境下Python 3.6.8 import matplotlib.pyplot 时出现的 importError: DLLload failed:找不到指定的模块

*在起初pip install matplotlib时,主动安装到当时最新版本(matplotlib==3.3.2),在StackOverflow以及国内众多帖子中总结以下解决方案

QRfiiqE.jpg!mobile

qAr6r2z.jpg!mobile

matplotlib依赖库版本不匹配问题(解决问题看下面)

本人在经历过无数次尝试matplotlib相关依赖库 numpy scipy 等安装卸载

找到所有matplotlib依赖库正确关系如下图所示,让众生少走些弯路,多留些头发。

matplotlib官网链接如下图

链接: https://matplotlib.org/users/installing.html.

图片:

JRN3yuq.jpg!mobile

这些依赖库最好检查一下,虽然我们检查完不解决问题

检查pip下安装包(依赖库)的命令如下

pip list

卸载安装包(依赖库)命令如下

pip uninstall 
<依赖库>


</依赖库>

pip install 依赖库>

安装

最终解决方案

报错原因 :import matplotlib.pyplot as plt 中所有依赖库版本满足要求,但还是报错的原因是在线pip install numpy时因为在线下载numpy库中缺少DLL,

在以上加州大学非官方库连接中MKL版本解决了这个问题

下载Numpy+MKL 版本 注意本机Python版本

(说明:下图中cp36是python3.6.x版本)

注意:下载速度贼鸡儿慢,如果有科学上网工具能好一点

**

由克里斯托夫Gohlke,实验室荧光动力学,加州大学欧文分校

适用于Python扩展程序包的非官方Windows二进制文件。

EN32Y3u.jpg!mobile

链接: https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy.

离线安装:

pip install 
<下载好的文件路径 文件名="">


</下载好的文件路径>

vyAJJzU.jpg!mobile


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK