Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'collections' has no attribute 'MutableMapping' #17

Open
pedro-acunha opened this issue Jul 19, 2022 · 0 comments

Comments

@pedro-acunha
Copy link

While executing the UnitTests.py file, the following error is given while using python 3.10:
AttributeError: module 'collections' has no attribute 'MutableMapping'

This is called due to a conflict in the new version of python where attribute MutableMapping is no longer in the module collections. It was moved to collections.abc.MutableMapping.

To work arround this issue, the compatibility.py file in ~/.local/lib/python3.10/site-packages/unittest2 should be edit as in here:

import collections 
if sys.version_info.major == 3 and sys.version_info.minor >= 10:
    from collections.abc import MutableMapping
else: 
    from collections import MutableMapping

Additionally, the class where "collections.MutableMapping" is called should be replace by "MutableMapping".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant