ModuleNotFoundError in ComfyUI even though the package is installed
A successful installation in a terminal does not show that ComfyUI uses the same Python. Separate the import name, distribution name and running interpreter before changing dependencies.
Symptoms and scope
A successful installation in a terminal does not show that ComfyUI uses the same Python. Separate the import name, distribution name and running interpreter before changing dependencies.
Error fragments for search; IDs, values and filenames may vary:
ModuleNotFoundError
No module named
Source-supported context
Official Portable installs use their own python_embeded interpreter. Python environments can have different packages. pip check validates declared dependency relationships; it does not execute every import. Source 1 Source 2 Source 3
Cases to distinguish
1. The package was installed into system Python rather than the running Portable or virtual environment.
2. Node requirements failed or were never installed, despite the node code being present.
3. The name in the import error differs from the distribution name, or the import fails deeper inside a native dependency.
Diagnostic sequence
The sequence below is an editorial procedure based on the cited context, not a diagnosis already confirmed for your environment.
Step 1. Start from the first traceback and its custom-node repository. Read that revision's requirements instead of guessing a package from the final error.
Step 2. In the actual ComfyUI interpreter, print sys.executable and run python -m pip --version. The checks below illustrate the Portable layout, not every installation type.
Step 3. Install only the identified, supported dependency set into that environment. A completed download alone is not a completed installation.
Step 4. Test the specific import, restart ComfyUI and inspect node registration. A subsequent DLL or ABI error needs its own diagnostic path rather than repeated installation of the top-level package.
Commands and request examples
Use the environment and shell identified above. Paths and variables are examples to adapt; these commands/snippets were not executed for your machine. Portable examples run from the package root. A virtual environment or managed launcher can use a different executable layout.
.\python_embeded\python.exe -c "import sys; print(sys.executable)"
.\python_embeded\python.exe -m pip --version
.\python_embeded\python.exe -m pip check
Completion check
The intended interpreter imports the dependency and the node registers. Record the resulting versions and test the required operation, not just pip's exit code.
Limitations and cautions
Avoid scripts that install many unrelated packages. The checks apply to the named installation layout; adapt the executable path for a managed launcher or virtual environment.
Original sources
- ComfyUI custom node troubleshooting — original record checked 2026-09-21.
- ComfyUI Portable Windows — original record checked 2026-09-21.
- pip check — 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-2102ComfyUI Portable WindowsSource checked: 2026-09-2103pip checkSource checked: 2026-09-21