Geoff Langenderfer
Geoff Langenderfer

Reputation: 946

AttributeError: module 'collections' has no attribute 'Mapping'

not sure what to do

and having a tough time installing an older version of python

Traceback (most recent call last):
  File "/home/g/.local/bin/cairo-compile", line 7, in <module>
    from starkware.cairo.lang.compiler.cairo_compile import main  # noqa
  File "/home/g/.local/lib/python3.10/site-packages/starkware/cairo/lang/compiler/cairo_compile.py", line 9, in <module>
    from starkware.cairo.lang.compiler.assembler import assemble
  File "/home/g/.local/lib/python3.10/site-packages/starkware/cairo/lang/compiler/assembler.py", line 7, in <module>
    from starkware.cairo.lang.compiler.program import CairoHint, Program
  File "/home/g/.local/lib/python3.10/site-packages/starkware/cairo/lang/compiler/program.py", line 25, in <module>
    from starkware.starkware_utils.marshmallow_dataclass_fields import IntAsHex
  File "/home/g/.local/lib/python3.10/site-packages/starkware/starkware_utils/marshmallow_dataclass_fields.py", line 6, in <module>
    from frozendict import frozendict
  File "/home/g/.local/lib/python3.10/site-packages/frozendict/__init__.py", line 16, in <module>
    class frozendict(collections.Mapping):
AttributeError: module 'collections' has no attribute 'Mapping'

Upvotes: 3

Views: 14442

Answers (1)

Geoff Langenderfer
Geoff Langenderfer

Reputation: 946

❯ vim +16 /home/g/.local/lib/python3.10/site-packages/frozendict/__init__.py

and modified line 16 this way:

- class frozendict(collections.Mapping):
+ class frozendict(collections.abc.Mapping):

good as new :)

Upvotes: 8

Related Questions