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

cannot import name 'MutableMapping' from 'collections' #290

Closed
csunlab opened this issue Nov 4, 2022 · 2 comments
Closed

cannot import name 'MutableMapping' from 'collections' #290

csunlab opened this issue Nov 4, 2022 · 2 comments

Comments

@csunlab
Copy link

csunlab commented Nov 4, 2022

Hi. I installed Spyder (standalone version) on a new Macbook Pro and installed neupy with "pip install neupy". The installation went fine, but my code gets this error when I run it: "cannot import name 'MutableMapping' from 'collections'." I followed the solution in this video, but it did not solve my problem.

Any thoughts? Thank you.

@cezang
Copy link

cezang commented Apr 16, 2023

In Python 3.10, collections.MutableMapping has been moved to the collections.abc module

@csunlab
Copy link
Author

csunlab commented Apr 16, 2023

Thanks. In the end, here's the fix that worked for me:

import collections
from collections import abc
from collections.abc import Mapping
collections.Mapping = collections.abc.Mapping
collections.MutableMapping = collections.abc.MutableMapping
collections.MutableSet = collections.abc.MutableSet
collections.Callable = collections.abc.Callable
collections.Iterable = collections.abc.Iterable

@csunlab csunlab closed this as completed Apr 16, 2023
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

2 participants