Skip to content

possible solution for the import problem in python 3.10 (import Mapping from collections) #91639

Closed
@Omar-Nour

Description

@Omar-Nour

Concerning python 3.10, the following error occurs for scripts trying to import Mapping from collections

Error:

ImportError: cannot import name 'Mapping' from 'collections' (/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py

Proposed Solution:

add the following line to the collections/__init__.py
Line : from collections.abc import Mapping

Reason:

Python scripts using the collections library from older versions would face problems when updating to python 3.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions