Cannot import name after an update: check the importing code and dependency together
The module may exist while an expected class or function no longer does. A partial update, API change or local name collision can look like a missing package but needs a different response.
Symptoms and scope
The module may exist while an expected class or function no longer does. A partial update, API change or local name collision can look like a missing package but needs a different response.
Error fragments for search; IDs, values and filenames may vary:
ImportError: cannot import name
AttributeError
Source-supported context
ComfyUI's custom-node troubleshooting distinguishes node conflicts from missing files. Disabling node code does not undo changes that its installer already made to shared Python dependencies. Source 1 Source 2
Cases to distinguish
1. The node version expects an API that the installed dependency no longer exposes.
2. Updates left duplicate or partially updated copies on the import path.
3. A local filename shadows the intended package, or a circular import leaves it partially initialized.
Diagnostic sequence
The sequence below is an editorial procedure based on the cited context, not a diagnosis already confirmed for your environment.
Step 1. Record the exact missing symbol, importing file and earliest traceback. Do not diagnose from the last queue error alone.
Step 2. Check the actual imported file path and versions. Preserve a backup before removing or moving suspected duplicate files.
Step 3. Test the author's supported node/dependency combination in an isolated copy. Restore a coherent snapshot rather than rolling back only main.py.
Step 4. Restart, run a minimal relevant workflow and report the exact pair of versions if the API failure persists.
Completion check
The symbol can be imported by the same runtime and the affected node operates. A clean pip check is useful, but does not establish API compatibility.
Limitations and cautions
Do not repair this by inventing replacement function signatures or upgrading the whole environment indiscriminately.
Original sources
- ComfyUI custom node troubleshooting — original record checked 2026-09-21.
- How to update ComfyUI — original record checked 2026-09-21.
Localization prepared: 2026-09-22. The source-check dates above were inherited from the existing article; this translation does not claim they were all rechecked today. No GPU run, minimum-memory measurement or runtime guarantee is supplied.
Related troubleshooting and guides
Was this page helpful?
Anonymous. Only a yes/no counter is stored; no account, IP address or device details.
Sources & references
Localized from the existing Chinese research draft. Original source-check dates are retained; this translation is not new technical verification or a runtime test.
01ComfyUI custom node troubleshootingSource checked: 2026-09-2102How to update ComfyUISource checked: 2026-09-21