Fix Custom Node requirements.txt Not Installed in ComfyUI
Fix ComfyUI custom nodes that fail to load because their requirements.txt dependencies were never installed in the correct Python environment.
Community Knowledge
This page is based on common ComfyUI troubleshooting patterns and has not been fully tested across all environments. Back up your environment before changing packages.
A ComfyUI custom node shows IMPORT FAILED in the startup log with a ModuleNotFoundError most often because the node's requirements.txt was never installed. Cloning or downloading a node into custom_nodes/ only copies the code; its Python packages must be installed separately, into the Python that starts ComfyUI.
IMPORT FAILED: ComfyUI-ExampleNode
Traceback (most recent call last):
File "...\custom_nodes\ComfyUI-ExampleNode\__init__.py", line 4, in <module>
import somepackage
ModuleNotFoundError: No module named 'somepackage'Triage
| Missing module | Common workflow area | First thing to verify |
|---|---|---|
triton | Acceleration, SageAttention, video, large-model workflows | Decide whether it is optional or fatal before installing |
sageattention | Wan/video acceleration and forced attention flags | Remove forced flags unless the workflow truly requires it |
onnx / onnxruntime | Face, pose, DWPose, ReActor, IPAdapter, video helpers | Prefer CPU onnxruntime first unless GPU ONNX is required |
llama_cpp | GGUF prompt helpers, local LLM/VLM nodes | Package is usually llama-cpp-python, not llama_cpp |
nunchaku | Nunchaku-backed FLUX/Qwen/SANA workflows | Do not install the unrelated PyPI nunchaku package |
sox / decord | Audio and video helper nodes | Identify the node pack first; do not batch-install every video package |
groundingdino / segment_anything | Detection, grounding, segmentation, masking | Use the SAM/GroundingDINO import guide, then confirm model assets |
dlib / nvvfx | Face/video effect workflows | Native wheels and platform support matter; read the plugin README first |
If a module is not in the table, the same rule applies: find the failing plugin first, then install the smallest needed dependency into the Python that starts ComfyUI.
Why it happens
- Manual git clone without pip install — the repo was cloned but requirements were never installed
- ComfyUI Manager partial install — the repo cloned but the requirements step failed silently
- Environment was rebuilt — reinstalling or updating the portable package wiped previously installed packages
- Wrong Python used — requirements went into system Python, not ComfyUI's embedded Python
- No requirements.txt — some nodes list dependencies only in their README
Step 1: Find the failing node
Check the startup log for the IMPORT FAILED line. It names the custom node folder and the missing module.
Step 2: Check whether requirements.txt exists
dir ComfyUI\custom_nodes\<node-name>\requirements.txtIf it exists, continue. If not, check the node's README on GitHub for manual dependency instructions.
Step 3: Read the requirements file before installing
type ComfyUI\custom_nodes\<node-name>\requirements.txtWatch for red flags before running it:
| What to watch for | Risk |
|---|---|
torch, torchvision, torchaudio | May replace your CUDA-enabled PyTorch with a CPU version |
Unpinned versions (no == or >=) | May install incompatible versions |
opencv-python when you have opencv-python-headless | Can cause DLL conflicts |
| Very old or very new version pins | May conflict with other nodes |
Step 4: Install the requirements
For Windows portable:
.\python_embeded\python.exe -s -m pip install -r ComfyUI\custom_nodes\<node-name>\requirements.txtFor a manual venv:
python -m pip install -r custom_nodes/<node-name>/requirements.txtIf the file would replace core packages like torch, install only the specific missing package instead:
.\python_embeded\python.exe -s -m pip install somepackageStep 5: Verify
Restart ComfyUI and confirm the IMPORT FAILED line is gone:
.\python_embeded\python.exe -s ComfyUI\main.py --windows-standalone-buildWhen not to run pip install blindly
- Always read
requirements.txtfirst — some authors pin aggressive torch versions. - If
pip checkshows conflicts after installing, fix the conflict before installing more. - Very old pins may not work with your current Python or PyTorch.
- Install one node at a time, checking for errors between installs, rather than batch-installing every node's requirements.
Related errors
- ComfyUI Plugin Import Failed
- ComfyUI Dependency Conflicts
- ComfyUI Custom Nodes Broke Environment
- Install Custom Nodes
- Plugin Missing Module Warning: When It Is Safe to Ignore
Source References
Start free with Wonderful Launcher if this affects your real ComfyUI environment. It keeps launcher-native repair, task logs, and runtime checks in one place; credits are only for image generation and metered tools.
Download Wonderful LauncherSee credit packagesDid this fix your issue?
Your answer helps prioritize verified ComfyUI repairs.