最近安装一个三方库时提示ImportError: cannot import name ‘Mapping’ from ‘collections’
2.先修改mapping.py文件第四行,
from collections import Mapping
修改为
from collections import namedtuple
from collections.abc import Mapping
3.运行之后发现仍然报错,修改mixins.py第五行
from collections import Mapping, MutableMapping, Sequence
修改为
from collections import namedtuple
from collections.abc import Mapping, Sequence, MutableMapping
4.运行仍然报错,修改merge.py文件第四行
from collections import Mapping
修改为
from collections import namedtuple
from collections.abc import Mapping
5.运行后仍然报错,修改mixins.py第162行
class MutableAttr(Attr, MutableMapping):
修改为
class MutableAttr(Attr, collections.abc.MutableMapping):
6.运行后仍然报错,修改default.py第4行
from collections import Mapping
修改为
from collections import namedtuple
from collections.abc import Mapping