【发布时间】:2022-02-02 02:53:35
【问题描述】:
我不确定如何修复此错误。我试过到处搜索。仅当我尝试与 matplotlib 交互时才会出现此错误。我的 pip 已完全升级,我正在使用 python 3.6.0 上课。谢谢!
Win32 上的 Python 3.6.0(v3.6.0:41df79263a11,2016 年 12 月 23 日,07:18:10)[MSC v.1900 32 位(英特尔)] 输入“help”、“copyright”、“credits”或“license”了解更多信息。
导入matplotlib 回溯(最近一次通话最后): 文件“”,第 1 行,在 文件“C:\Users\syner\AppData\Local\Programs\Python\Python36-32\lib\site-packages\matplotlib_init_.py”,第 107 行,在 从 。导入 cbook、rcsetup 文件“C:\Users\syner\AppData\Local\Programs\Python\Python36-32\lib\site-packages\matplotlib\rcsetup.py”,第 28 行,在 从 matplotlib.fontconfig_pattern 导入 parse_fontconfig_pattern 文件“C:\Users\syner\AppData\Local\Programs\Python\Python36-32\lib\site-packages\matplotlib\fontconfig_pattern.py”,第 15 行,在 from pyparsing import (Literal, ZeroOrMore, Optional, Regex, StringEnd, 文件“C:\Users\syner\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pyparsing_init_.py”,第 130 行,在 版本 = version_info。版本 AttributeError: 'version_info' 对象没有属性 'version'
【问题讨论】:
-
试试这个:
import matplotlib;print('matplotlib: {}'.format(matplotlib.__version__)) -
感谢您的评论。它仍然给出相同的错误并且不打印版本。
-
但是,当我在 cmd 窗口中运行 'pip show matplotlib' 时,它显示 3.3.4
标签: python matplotlib attributeerror