Skip to main content

ComfyUI ModuleNotFoundError / "No module named" — custom node won't import

A ModuleNotFoundError at ComfyUI startup almost always means a custom node's Python dependency didn't install — the node folder is there, but a package it imports is missing.

Also seen as: "ModuleNotFoundError", "No module named", "ImportError", "cannot import"

Direct answer

How do I fix "Missing Python Package"?

A ModuleNotFoundError at ComfyUI startup almost always means a custom node's Python dependency didn't install — the node folder is there, but a package it imports is missing.

Key facts

  • iA custom node's requirements.txt never ran (headless installs skip it).
  • iA from-source build (sam2, llama-cpp-python, insightface) failed or timed out.
  • iPython/torch version mismatch — a wheel built for a different version.

Next step

  1. 1Reinstall the node's requirements: pip install -r custom_nodes/<node>/requirements.txt.
  2. 2For from-source packages, use --prefer-binary and a longer build timeout, or a prebuilt wheel.
  3. 3Paste the workflow into a checker that resolves each node to its repo + install command before you deploy.
  4. 4Match torch/CUDA versions to what the node was built against.

Not a fit when

  • Reinstalling the node folder won't help if the missing package is a system build dependency.

Not sure this workflow will run before you rent a GPU?

Paste your ComfyUI workflow JSON into the free checker — it flags missing nodes, model requirements, and the VRAM/GPU you actually need. No signup.

Other ComfyUI errors

Frequently Asked Questions

What causes "Missing Python Package" in ComfyUI?

A custom node's requirements.txt never ran (headless installs skip it).

How do I fix "Missing Python Package"?

Reinstall the node's requirements: pip install -r custom_nodes/<node>/requirements.txt. For from-source packages, use --prefer-binary and a longer build timeout, or a prebuilt wheel.