Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I've been using matplotlib without any problem, but yesterday I tried to install an other library that uses matplotlib and since that I have an error that I can't avoid. Could someone help me?

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'
like image 921
Cristina Dominguez Fernandez Avatar asked May 04 '26 07:05

Cristina Dominguez Fernandez


1 Answers

What version of matplotlib are you using?

$ pip install matplotlib
$ python3

>>> matplotlib.version

then...

see the complete list of modules (example: matplotlib 3.5.1):

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

like image 59
Berzeker Avatar answered May 05 '26 19:05

Berzeker



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!