python本地安装库报错ImportError: cannot import name ‘Mapping‘ from ‘collections‘的解决方法

最近安装一个三方库时提示ImportError: cannot import name ‘Mapping’ from ‘collections’
python本地安装库报错ImportError: cannot import name ‘Mapping‘ from ‘collections‘的解决方法_第1张图片
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

7.运行后提示缺少c++
python本地安装库报错ImportError: cannot import name ‘Mapping‘ from ‘collections‘的解决方法_第2张图片
8.360管家安装c++合集

你可能感兴趣的:(python)