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

那原因是什么呢?

DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working

也就是说,from collections import Mapping, MutableMapping 这种用法在 python3.10 上已经被移除了

从 python3.3 开始,就应该使用 from collections.abc import MutableMapping 替代 from collections import Mapping, MutableMapping

在 python3.10 上,彻底移除了 from collections import Mapping, MutableMapping 这种用法


universe_king
3.4k 声望680 粉丝