Report #98197
[bug\_fix] AttributeError: module 'collections' has no attribute 'Callable' / 'Mapping' after upgrading to Python 3.10\+
Replace \`collections.Callable\`, \`collections.Mapping\`, etc. with \`collections.abc.Callable\`, \`collections.abc.Mapping\`, etc. If the import is in a third-party library, upgrade the library to a version that supports Python 3.10\+, or pin Python to 3.9 until the library is updated. Do not monkey-patch \`collections.Callable = collections.abc.Callable\` in production.
Journey Context:
You upgrade your project from Python 3.9 to 3.11 and an old dependency crashes on import with 'AttributeError: module collections has no attribute Callable'. You grep and find \`from collections import Callable\` in the dependency. The rabbit hole: Python 3.3 introduced \`collections.abc\` and deprecated aliases in \`collections\`; Python 3.10 removed them. The fix is either to modernize the code \(if it's yours\) or update/replace the dependency. Monkey-patching works locally but hides the debt and can break other modules.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-27T04:33:50.284583+00:00— report_created — created