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' #44

Open
Anbinhngo opened this issue Oct 1, 2022 · 1 comment

Comments

@Anbinhngo
Copy link

Hi, everyone so i want to extract the payload.bin and i got this:
python payload_dumper.py payload.bin
Traceback (most recent call last):
File "C:\Users\ngoan\AppData\Local\Programs\Python\Python310\payload_dumper.py", line 12, in
import update_metadata_pb2 as um
File "C:\Users\ngoan\AppData\Local\Programs\Python\Python310\update_metadata_pb2.py", line 8, in
from google.protobuf import reflection as _reflection
File "C:\Users\ngoan\AppData\Local\Programs\Python\Python310\lib\site-packages\google\protobuf\reflection.py", line 58, in
from google.protobuf.internal import python_message as message_impl
File "C:\Users\ngoan\AppData\Local\Programs\Python\Python310\lib\site-packages\google\protobuf\internal\python_message.py", line 62, in
from google.protobuf.internal import containers
File "C:\Users\ngoan\AppData\Local\Programs\Python\Python310\lib\site-packages\google\protobuf\internal\containers.py", line 182, in
MutableMapping = collections.MutableMapping
AttributeError: module 'collections' has no attribute 'MutableMapping'

If anyone has answer let me know. Thanks!

@KarboXXX
Copy link

KarboXXX commented Jan 9, 2023

same error, i see you are using python3.10, same mistake as me. downgrade to at least 3.8 or 3.9 and run from there, python3.8 -m pip install -r requirements.txt

you see, python3.10 does not contain the attribute MutableMapping from the module collections, which have been removed from this version, existing previously on 3.8.

you can verify that looking at the differences between at /usr/lib/python3.8 and /usr/lib/python3.10 on Linux, for example (idk the paths on Windows, i'm sorry)

$ ls -l /usr/lib/python3.8/

total 4884
...
-rw-r--r-- 1 root root  10622 dez  6 22:12 code.py
drwxr-xr-x 3 root root   4096 dez  7 20:16 collections          <------- folder
-rw-r--r-- 1 root root  26100 dez  6 22:12 _collections_abc.py
...

$ ls -l /usr/lib/python3.10/

total 5036
...
-rw-r--r-- 1 root root  10622 nov 14 13:10 code.py
drwxr-xr-x 3 root root   4096 dez 17 05:30 collections          <------- folder
-rw-r--r-- 1 root root  32045 nov 14 13:10 _collections_abc.py
...

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