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

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

不知道该怎么做

并且很难安装旧版本的 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'

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

并以这种方式修改第 16 行:

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

像新的一样:)