Skip to content

Cannot import name 'MutableSequence' from 'collections' (Python 3.10) #8

@michalzmuda

Description

@michalzmuda

I get the following error when I try to use IPAString in new project

from ipapy.ipastring import IPAString

if __name__ == '__main__':
    IPAString(unicode_string="tɛst")

Error:

Traceback (most recent call last):
  File "D:\dev\tes1\main.py", line 1, in <module>
    from ipapy.ipastring import IPAString
  File "D:\dev\tes1\venv\lib\site-packages\ipapy\ipastring.py", line 10, in <module>
    from collections import MutableSequence
ImportError: cannot import name 'MutableSequence' from 'collections' (C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1776.0_x64__qbz5n2kfra8p0\lib\collections\__init__.py)

Resolution is to change ipastring.py:10:
from
from collections import MutableSequence
to
from collections.abc import MutableSequence

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions