zoukankan      html  css  js  c++  java
  • 解决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      

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

  • 相关阅读:
    renderer:function参数介绍
    JSF request参数传递
    jsf初学解决faces 中文输入乱码问题
    JSF中获得HTTP SESSION和Request
    jquery、js调用iframe父窗口与子窗口元素的方法整理
    android 手势识别学习
    JAVA事件监听机制学习
    我的android学习脚步----------- 的第一个应用
    图像处理之哈哈镜的实现
    图像处理知识随笔
  • 原文地址:https://www.cnblogs.com/BlogOfMr-Leo/p/8546901.html
Copyright © 2011-2022 走看看