The Iterable abstract class was removed from collections in Python 3.10. See the deprecation note in the 3.9 collections docs.
There are couple of ways to fix the above error.
- Use any previous version of Python3.3+
- import from collections.abc class
import sys sys.version
'3.9.7 (default, Sep 16 2021, 13:09:58) \n[GCC 7.5.0]'
from collections import Iterable
/tmp/ipykernel_3591499/2097383490.py:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working 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
from collections.abc import Iterable
- Movie Name Generation Using GPT-2
- How To Fix Error Pandas Cannot Open An Excel xlsx File
- Return Multiple Values From a Function in Python
- 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