Running python 3.10.6, I get the import error regarding Iterable. This is due to the fact the tuple comparison is using string comparison which alphabetical.
For example:
In [6]: python_version_tuple() >= ("3", "3", "0")
Out[6]: False
In [7]: python_version_tuple() >= ("3", '3', "0")
Out[7]: False
In [9]: python_version_tuple()
Out[9]: ('3', '10', '6')
In [10]: ('3', '10', '6') > ('3', '9', '6')
Out[10]: False
ImportError: cannot import name 'Iterable' from 'collections' (/home/pruan/.pyenv/versions/3.10.6/lib/python3.10/collections/__init__.py)
I think the solution is to use sys.version_info instead like this:
In [31]: sys.version_info > (3, 3, 0)
Out[31]: True
Running python 3.10.6, I get the import error regarding
Iterable. This is due to the fact the tuple comparison is using string comparison which alphabetical.For example:
ImportError: cannot import name 'Iterable' from 'collections' (/home/pruan/.pyenv/versions/3.10.6/lib/python3.10/collections/__init__.py)I think the solution is to use sys.version_info instead like this: