No module named 'matplotlib.typing'

88 Views Asked by At

I am receiving an error message: ModuleNotFoundError: No module named 'matplotlib.typing' with this bit of code:

from plotnine import *

(ggplot(the, aes(x='Trial', y='Weights', colour='Cues')) +
    geom_line() +
    scale_colour_manual(values=['#1f78b4','#b2df8a','#fb9a99','#e31a1c','#ae017e']))

I am running Anaconda on macOS:

  • conda 23.7.4
  • plotnine 0.13.0 pypi_0 pypi
  • matplotlib 3.7.1 py311hecd8cb5_1

This, however, works on my older machine with all the same specs but plotnine being 0.12.4.

Can you please help? Thanks!

2

There are 2 best solutions below

1
striatum On BEST ANSWER

The plotnine needs to be downgraded:

pip install plotnine==0.12.4
0
Kanak On

Try running this code

`conda install -c conda-forge plotnine=0.12.4`