最近在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      

将其改过来,然后运行。问题完美解决。

 

相关文章:

  • 2022-12-23
  • 2022-01-17
  • 2021-12-22
  • 2021-12-05
  • 2022-01-07
  • 2021-12-28
  • 2021-07-19
  • 2021-12-20
猜你喜欢
  • 2021-12-09
  • 2021-08-17
  • 2021-08-29
  • 2022-12-23
  • 2021-12-31
  • 2021-05-06
相关资源
相似解决方案