Matplotlib错误:属性错误:模块“matplotlib”没有属性“rcParams”

dw1jzc5e  于 2023-08-06  发布在  其他
关注(0)|答案(1)|浏览(271)

我一直在使用matplotlib没有任何问题,但昨天我试图安装一个使用matplotlib的其他库,因为我有一个错误,我无法避免。有人能帮帮我吗

AttributeError                            Traceback (most recent call last)
<ipython-input-18-b478a6fd18e5> in <module>
      1 import pandas as pd
      2 import numpy as np
----> 3 import matplotlib.pyplot as plt

~\anaconda3\lib\site-packages\matplotlib\pyplot.py in <module>
     47 from cycler import cycler
     48 import matplotlib
---> 49 import matplotlib.colorbar
     50 import matplotlib.image
     51 from matplotlib import _api

~\anaconda3\lib\site-packages\matplotlib\colorbar.py in <module>
     19 
     20 import matplotlib as mpl
---> 21 from matplotlib import _api, collections, cm, colors, contour, ticker
     22 import matplotlib.artist as martist
     23 import matplotlib.patches as mpatches

~\anaconda3\lib\site-packages\matplotlib\collections.py in <module>
     18 
     19 import matplotlib as mpl
---> 20 from . import (_api, _path, artist, cbook, cm, colors as mcolors, docstring,
     21                hatch as mhatch, lines as mlines, path as mpath, transforms)
     22 from ._enums import JoinStyle, CapStyle

~\anaconda3\lib\site-packages\matplotlib\artist.py in <module>
     13 import matplotlib as mpl
     14 from . import _api, cbook
---> 15 from .cm import ScalarMappable
     16 from .path import Path
     17 from .transforms import (Bbox, IdentityTransform, Transform, TransformedBbox,

~\anaconda3\lib\site-packages\matplotlib\cm.py in <module>
     34 
     35 
---> 36 _LUTSIZE = mpl.rcParams['image.lut']
     37 
     38 

AttributeError: module 'matplotlib' has no attribute 'rcParams'

字符串

hmtdttj4

hmtdttj41#

你使用的是什么版本的matplotlib?

$ pip install matplotlib
$ python3

>>> matplotlib.version

字符串
那...
请参见模块的完整列表(例如:matplotlib 3.5.1):
https://matplotlib.org/stable/py-modindex.html

相关问题