redisworks icon indicating copy to clipboard operation
redisworks copied to clipboard

Cannot import MutableMapping

Open tiltowait opened this issue 3 years ago • 2 comments

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.

tiltowait avatar Jul 12 '22 05:07 tiltowait

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.

ssoj13 avatar Aug 03 '22 16:08 ssoj13

Hi @tiltowait and @ssoj13 Thanks for reporting the issue. It will be an easy fix. I will make a PR.

seperman avatar Aug 03 '22 19:08 seperman

@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!

YAMLcase avatar Nov 06 '22 01:11 YAMLcase

Redisworks 0.4.0 is released and this issue is resolved.

seperman avatar Nov 06 '22 05:11 seperman

0.4.0 works perfectly, thanks!

YAMLcase avatar Nov 06 '22 17:11 YAMLcase