Issue
I want to execute the following example:
from attrdict import AttrDict
a = AttrDict({'foo': 'bar'})
print(a.foo)
but I got this error: ImportError: cannot import name 'Mapping' from 'collections' (C:\Users\user\AppData\Local\Programs\Python\Python310\lib\collections\__init__.py)
How can I solve it? I feel it is like bug. And when I looked inside the file I noticed some problems in it:
C:\Users\user\AppData\Local\Programs\Python\Python310\lib\collections\__init__.py
:
Solution
The AttrDict project was broken by a change in the move to Python 3.10 but since it was marked as inactive in 2019, this hasn't been fixed.
I found a discussion that seems to indicate that it will be reopened but that doesn't seem to have happened. Looks like we'll have to find alternatives, check out addict
.
Answered By - Motti
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.