The Iterable abstract class was removed from collections in Python 3.10. See the deprecation note in the 3.9 collections docs.
https://docs.python.org/3/library/collections.abc.html#collections-abstract-base-classes
There are couple of ways to fix the above error.
- Use any previous version of Python3.3+
- import from collections.abc class
In [1]:
import sys
sys.version
Out[1]:
In [2]:
from collections import Iterable
Note the warning above but since version is python3.9, it works.
In Python 3.10, above command will output following error.
ImportError: cannot import name 'Iterable' from 'collections'
To resolve above error, import from collections.abc
In [3]:
from collections.abc import Iterable
Related Notebooks
- Movie Name Generation Using GPT-2
- Return Multiple Values From a Function in Python
- How To Fix Error Pandas Cannot Open An Excel xlsx File
- Five Ways To Remove Characters From A String In Python
- How To Take String Input From Command Line In Python
- How To Take Integer Input From Command Line In Python
- Time Series Analysis Using ARIMA From StatsModels
- Calculate Stock Options Max Pain Using Data From Yahoo Finance With Python
- Remove An Item From A List In Python Using Clear Pop Remove And Del