redisworks
redisworks copied to clipboard
Cannot import MutableMapping
Attempting to import redisworks on Python 3.10 gives the following error:
Traceback (most recent call last):
File "/Users/tiltowait/r.py", line 3, in <module>
from redisworks import Root
File "/opt/homebrew/lib/python3.10/site-packages/redisworks/__init__.py", line 2, in <module>
from .redisworks import Root # NOQA
File "/opt/homebrew/lib/python3.10/site-packages/redisworks/redisworks.py", line 7, in <module>
from dot import Dot
File "/opt/homebrew/lib/python3.10/site-packages/dot/__init__.py", line 1, in <module>
from .dot import Dot, LazyDot
File "/opt/homebrew/lib/python3.10/site-packages/dot/dot.py", line 9, in <module>
from collections import MutableMapping
ImportError: cannot import name 'MutableMapping' from 'collections' (/opt/homebrew/Cellar/[email protected]/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py)
This is because MutableMapping has moved from collections to collections.abc.
Just encountered the same: starting from Python 3.10 it's supposed to be from collections.abc import MutableMapping and support for old from collections import ... was dropped in Python 3.9.
Right now redisworks doesn't work out of the box and breaks on import both because it's using collections and dotobject that suffers from the same problem.
I quickly hacked couple of files in installed packages, but would be nice to fix the source of problem.
Hi @tiltowait and @ssoj13 Thanks for reporting the issue. It will be an easy fix. I will make a PR.
@seperman any progress? I just encountered the same issue w/ python 3.10.
@ssoj13 can you share your workaround? I need something to work until the PR gets in.
Thanks y'all!
Redisworks 0.4.0 is released and this issue is resolved.
0.4.0 works perfectly, thanks!