• 解决Pycharm中matplotlib画图出错问题(AttributeError: module 'matplotlib' has no attribute 'verbose')


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

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

  • 相关阅读:
    第03组 Beta冲刺(1/4)
    第03组 Alpha事后诸葛亮
    第03组 Alpha冲刺(4/4)
    第03组 Alpha冲刺(3/4)
    第03组 Alpha(2/4)
    第03组 Alpha冲刺(1/4)
    第03组团队Git现场编程实战
    第二次结对编程作业
    团队项目-需求分析报告
    第01组 Beta冲刺(3/5)
  • 原文地址:https://www.cnblogs.com/BlogOfMr-Leo/p/8546901.html
Copyright © 2020-2023  润新知