ImportError: cannot import name 'Mapping' from 'collections'
Python 2024/4/2 21:52:06 点击:不统计
在调用python3.10 flask 应用扩展时,遇到了
ImportError: cannot import name 'Mapping' from 'collections'
AttributeError: module 'collections' has no attribute 'MutableMapping'
错误文件:
python3.10/site-packages/markupsafe/__init__.py", line 13,
python3.10/site-packages/jinja2/tests.py", line 12
python3.10.0/lib/python3.10/importlib/__init__.py", line 126
解决方法
将 : from collections import Mapping
修改为: from collections.abc import Mapping