python3升級後的報錯

black_man發表於2024-03-07

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

將collections替換為collections.abc即可

比如

from collections import Mapping
# 替換為
from collections.abc import Mapping


import collections 
# 替換為
import collections.abc as collections

相關文章