idea python 运行脚本报错AttributeError: module 'matplotlib' has no attribute 'verbose'

1、问题描述

idea的版本:2017.3.3

python插件的版本:2017.3.173.4301.35

代码引用了画图包:matplotlib

idea python 运行脚本报错AttributeError: module 'matplotlib' has no attribute 'verbose'

matplotlib版本:3.0.3

运行代码出错:

AttributeError: module 'matplotlib' has no attribute 'verbose'

报错的文件:

C:\Users\Administrator\.IntelliJIdea2017.3\config\plugins\python\helpers\pycharm_matplotlib_backend\backend_interagg.py

idea python 运行脚本报错AttributeError: module 'matplotlib' has no attribute 'verbose'

是引用了verbose方法出错了,这个方法不存在。

2、解决方案
先卸载matplotlib 3.0.3:pip uninstall matplotlib
然后安装matplotlib 2.1.2:pip install matplotlib==2.1.2

在运行代码就通过了。

3、分析原因

我的idea的版本有点老,对应的python插件的版本也老,老版本的python插件不支持新版本的matplotlib包,所以插件的代码就报错了。多亏是画图的包,老点不影响大局。