0

I got this error today when trying to import seaborn today, and I cannot figure out how to address this at all.

I know that I need to open my matplotlibrc file and search for axes.color_cycle but I cannot figure that part out either for the life of me. Really not sure how to resolve this, and any help would be greatly appreciated.

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
~\Anaconda3\lib\site-packages\matplotlib\__init__.py in __setitem__(self, key, val)
    800             try:
--> 801                 cval = self.validate[key](val)
    802             except ValueError as ve:

KeyError: 'axes.color_cycle'

During handling of the above exception, another exception occurred:

KeyError                                  Traceback (most recent call last)
<ipython-input-10-3678922524a5> in <module>
      3 from datetime import datetime
      4 import matplotlib.pyplot as plt
----> 5 import seaborn as sns
      6 import pandas as pd
      7 import numpy as np

~\Anaconda3\lib\site-packages\seaborn\__init__.py in <module>
     11 from .xkcd_rgb import xkcd_rgb
     12 from .crayons import crayons
---> 13 set()
     14 
     15 __version__ = "0.6.0"

~\Anaconda3\lib\site-packages\seaborn\rcmod.py in set(context, style, palette, font, font_scale, color_codes, rc)
     96     set_context(context, font_scale)
     97     set_style(style, rc={"font.family": font})
---> 98     set_palette(palette, color_codes=color_codes)
     99     if rc is not None:
    100         mpl.rcParams.update(rc)

~\Anaconda3\lib\site-packages\seaborn\rcmod.py in set_palette(palette, n_colors, desat, color_codes)
    489     """
    490     colors = palettes.color_palette(palette, n_colors, desat)
--> 491     mpl.rcParams["axes.color_cycle"] = list(colors)
    492     mpl.rcParams["patch.facecolor"] = colors[0]
    493     if color_codes:

~\Anaconda3\lib\site-packages\matplotlib\__init__.py in __setitem__(self, key, val)
    805         except KeyError:
    806             raise KeyError(
--> 807                 f"{key} is not a valid rc parameter (see rcParams.keys() for "
    808                 f"a list of valid parameters)")
    809 

KeyError: 'axes.color_cycle is not a valid rc parameter (see rcParams.keys() for a list of valid parameters)'
wuerfelfreak
  • 2,363
  • 1
  • 14
  • 29
  • You seem to be running a very old version of Seaborn. Current is `0.10.1` – JohanC May 11 '20 at 22:37
  • See also [this post](https://stackoverflow.com/questions/60982373/keyerror-axes-color-cycle-is-not-a-valid-rc-parameter-see-rcparams-keys-for). `color_cycle` has been deprecated long ago and replaced by `prop_cycle`. – JohanC May 11 '20 at 22:41
  • Yeah I think I accidentally installed an old version of Seaborn. I'll try installing the most up to date version, and re-running – timmytam13 May 11 '20 at 22:45
  • 2
    Does this answer your question? [KeyError: 'axes.color\_cycle is not a valid rc parameter (see rcParams.keys() for a list of valid parameters)'](https://stackoverflow.com/questions/60982373/keyerror-axes-color-cycle-is-not-a-valid-rc-parameter-see-rcparams-keys-for) – Greenonline Apr 27 '21 at 10:12

0 Answers0