最近在Linux中使用pycharm过程中使用matplotlib无法画图,总是提示错误
/usr/bin/python3.5 /home/leo/PycharmProjects/untitled1/Euler.py Traceback (most recent call last): File "/home/leo/PycharmProjects/untitled1/Euler.py", line 5, in <module> import matplotlib.pyplot as plt File "/usr/local/lib/python3.5/dist-packages/matplotlib/pyplot.py", line 115, in <module> _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup() File "/usr/local/lib/python3.5/dist-packages/matplotlib/backends/__init__.py", line 62, in pylab_setup [backend_name], 0) File "/home/leo/pycharm-2017.3.4/helpers/pycharm_matplotlib_backend/backend_interagg.py", line 17, in <module> verbose = matplotlib.verbose AttributeError: module 'matplotlib' has no attribute 'verbose'
根据提示出错的文件,进入最后一行提示的文件,进入文件,
from matplotlib.backend_bases import FigureManagerBase, ShowBase from matplotlib.backends.backend_agg import FigureCanvasAgg from matplotlib.figure import Figure HOST = 'localhost' PORT = os.getenv("PYCHARM_MATPLOTLIB_PORT") PORT = int(PORT) if PORT is not None else None PORT = PORT if PORT != -1 else None index = int(os.getenv("PYCHARM_MATPLOTLIB_INDEX", 0)) rcParams = matplotlib.rcParams verbose = matplotlib.verbose
出错在verbose=matplotlib.verbose这里
因为在Python3中matplotlib中是Verbose
!!!!!!!!!!注意:大写的V
将其改过来,然后运行。问题完美解决。