[MacPorts] #65990: Importing py310-oset generates "ImportError: cannot import name 'MutableSet' from 'collections'"

MacPorts noreply at macports.org
Fri Oct 14 03:05:35 UTC 2022


#65990: Importing py310-oset generates "ImportError: cannot import name
'MutableSet' from 'collections'"
--------------------+------------------------
 Reporter:  outis   |      Owner:  (none)
     Type:  defect  |     Status:  new
 Priority:  High    |  Milestone:
Component:  ports   |    Version:
 Keywords:          |       Port:  py310-oset
--------------------+------------------------
 When importing oset for Python 3.10, it generates the error:

   ImportError: cannot import name 'MutableSet' from 'collections'

 with the traceback:

   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10
 /site-packages/oset/__init__.py", line 3, in <module>
       from oset.pyoset import oset
     File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10
 /site-packages/oset/pyoset.py", line 16, in <module>
       from collections import MutableSet
   ImportError: cannot import name 'MutableSet' from 'collections'
 (/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py)


 `MutableSet`, along with other container classes, were moved from
 `collections` to `collections.abc` in Python 3.3, though aliases were
 maintained in later versions. Those aliases aren't present in Python 3.10,
 hence the error. The line should be updated to:

 {{{#!python
 from collections.abc import MutableSet
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/65990>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list