引用matplotl坡纠课柩ib包的时候出现一个问题,百度一下才知道问题再哪里,我们先来看看问题是什么。错误提示为:I罪焐芡拂mportError: matplotlib requires dateutil
我使用二进制安装文件来安装这个包,安装过程没有出现任何问题![Python教程:[53]matplotlib安装错误](https://exp-picture.cdn.bcebos.com/c255efc595ee41c15bd6a3e78d88912ca4ca9b45.jpg)
在我使用【import matplotlib】引入该模块的时候,出现了这个错误:
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import matplotlib
File "D:\Python27\lib\site-packages\matplotlib\__init__.py", line 111, in <module>
raise ImportError("matplotlib requires dateutil")
ImportError: matplotlib requires dateutil
其实就是引入matplotlib模块需要用到dateutil模块,那么我们可以通过easy_install命令来安装:假如你没用过easy_install ,你可以看这篇文章http://jingyan.baidu.com/article/2a1383284db4e2074a134f2c.html假如你没有安装setuptools,我们可以看这篇文章进行安装:http://jingyan.baidu.com/article/b907e627dd80df46e7891c2c.html
打开cmd窗口![Python教程:[53]matplotlib安装错误](https://exp-picture.cdn.bcebos.com/ad121888912ca5ca2d199ffc8bfc77f7990e9445.jpg)
输入这个,找不到这个模块![Python教程:[53]matplotlib安装错误](https://exp-picture.cdn.bcebos.com/ccc83ec5260f8835227b566ace07880139708645.jpg)
我们得用:easy_install python-dateutil![Python教程:[53]matplotlib安装错误](https://exp-picture.cdn.bcebos.com/9881b1fce186242fb5809bab35e434daf15ee845.jpg)
![Python教程:[53]matplotlib安装错误](https://exp-picture.cdn.bcebos.com/0fb94656d53da824e41bc366306651598440cb45.jpg)
安装好了以后,我们就可以正确引用matplotlib![Python教程:[53]matplotlib安装错误](https://exp-picture.cdn.bcebos.com/7c84d1672b5fd5466464b7a07fd0b503c9d2244a.jpg)