首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Matplotlib错误: AttributeError:模块'matplotlib‘没有属性'rcParams’

Matplotlib错误: AttributeError:模块'matplotlib‘没有属性'rcParams’
EN

Stack Overflow用户
提问于 2022-02-14 14:46:20
回答 1查看 4K关注 0票数 4

我一直在使用matplotlib,没有任何问题,但是昨天我尝试安装另一个使用matplotlib的库,从那以后,我有一个无法避免的错误。有人能帮我吗?

代码语言:javascript
复制
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'
EN

回答 1

Stack Overflow用户

发布于 2022-02-14 17:29:13

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

代码语言:javascript
复制
$ pip install matplotlib
$ python3

>>> matplotlib.version

然后..。

请参阅完整的模块列表(例如: matplotlib 3.5.1):

https://matplotlib.org/stable/py-modindex.html

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71113718

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档