Wednesday, June 1, 2022

[SOLVED] Cannot import name 'iterable' from 'matplotlib.cbook'

Issue

Recently, I updated to Ubuntu 22. I am using python 3.10.

After installing matplotlib and other required libraries for python, I am trying to plot some graphs.

Everytime I am facing this error while running my code. I followed all the solutions given in stackoverflow or Google but no luck.

This is the error I am getting:

File ~/.local/lib/python3.10/site-packages/prettyplotlib/_eventplot.py:3, in <module>
      1 __author__ = 'jgosmann'
----> 3 from matplotlib.cbook import iterable
      5 from prettyplotlib.utils import remove_chartjunk, maybe_get_ax
      6 from prettyplotlib.colors import set2

ImportError: cannot import name 'iterable' from 'matplotlib.cbook'

When I imported matplotlib, there is no issue.

How can I get rid of this error? Any help or suggestion would be appreciated.

Thank you


Solution

If anyone searching for the answer to solve this issue,

then follow the following steps:

step 1) uninstall matplotlib completely

step 2 ) Then install matplotlib : pip3 install -U matplotlib==3.2



Answered By - Codeholic
Answer Checked By - Dawn Plyler (WPSolving Volunteer)