LogoWonderful Launcher
  • Product
  • Pricing
  • Solutions
  • Docs
  • Blog
  • Get Help
  • Download
No Module NamedComfyUI Dependency Conflicts: Fix Without ReinstallingTorch MissingTransformers MissingONNX MissingSageAttention MissingInsightFace MissingOpenCV / cv2 Missing
Missing Packages

Fix No module named errors in ComfyUI

Partially verifiedMedium riskTested on Windows 10, Windows 11 | portable | Python 3.11 | CUDA 12.x | Torch 2.x | ComfyUI portable and manual venv patternsLast verified 2026-05-21Estimated time 5-20 minutes

Diagnose ComfyUI ModuleNotFoundError and No module named errors by package name, Python environment, custom node dependency, and CUDA or PyTorch mismatch.

You can fix it manually, or download Wonderful Launcher for Windows to diagnose plugin errors, missing dependencies, and broken ComfyUI environments without reinstalling.

Download free for Windows

If ComfyUI prints ModuleNotFoundError: No module named ..., the missing Python package is only part of the diagnosis. The more important question is which Python environment launched ComfyUI.

For the official Windows portable package, package commands usually need to run through:

.\python_embeded\python.exe -s -m pip ...

For a manual Git install, activate the same virtual environment that starts ComfyUI, then use:

python -m pip ...

Related errors

No module named 'sageattention'Partially verifiedNo module named 'cv2'Partially verifiedNo module named 'insightface'Partially verifiedNo module named 'onnxruntime'Partially verifiedNo module named 'transformers'Partially verified

Fast Diagnosis

What the log saysMost likely causeFirst check
ModuleNotFoundError from custom_nodesA custom node dependency is missingRead the plugin folder and its requirements.txt
ModuleNotFoundError from ComfyUI\comfy\...A core ComfyUI dependency is missing or driftedCheck local ComfyUI\requirements.txt
pip install succeeds but the error remainsInstalled into the wrong PythonRun pip show with ComfyUI's Python
Error changes after restartYou fixed the first blocker and exposed the next oneContinue with the new first traceback
CUDA, DLL, or wheel errors appearPackage has native or GPU dependenciesCheck Torch/CUDA before changing more packages

Step 1: Copy the Exact Missing Module

Start with the copied line, not the package you guessed:

ModuleNotFoundError: No module named 'sageattention'

The import name and the pip package name are not always identical. For example, cv2 usually comes from an OpenCV package, and segment_anything comes from segment-anything.

Step 2: Find the Python That Starts ComfyUI

For Windows portable, run from the portable package root:

.\python_embeded\python.exe -s -m pip --version
.\python_embeded\python.exe -s -m pip show <package-name>

For manual venv installs:

python -m pip --version
python -m pip show <package-name>

The output path should point into the same ComfyUI environment. If it points to system Python, the repair is happening in the wrong place.

Step 3: Decide Whether the Missing Package Is Fatal

Not every missing optional acceleration package should be fixed immediately.

Missing moduleOften fatal?Notes
transformers from ComfyUI coreYesCore tokenizer/model stack may fail before startup
torchYesComfyUI cannot run without a working PyTorch install
cv2Often plugin-fatalMany vision custom nodes need OpenCV
sageattentionOften optionalFix only if a workflow or launch flag requires it
onnxruntimeWorkflow-dependentFace, pose, and ONNX-backed nodes may need it
diffusersPlugin-dependentUsually a third-party node requirement

Step 4: Install the Specific Fix

Use the specific guide when it exists:

  • No module named 'sageattention'
  • No module named 'cv2'
  • No module named 'insightface'
  • No module named 'onnx' or 'onnxruntime'
  • No module named 'transformers'
  • No module named 'torch'
  • No module named 'triton'

Do not install every related package at once. Restart after each repair and read the new first error.

Step 5: Verify the Repair

Before restarting ComfyUI, verify the import in the same Python:

python -c "import <module_name>; print('import ok')"

For Windows portable, use:

.\python_embeded\python.exe -s -c "import <module_name>; print('import ok')"

Then restart ComfyUI. The original ModuleNotFoundError should be gone, and the affected custom node or workflow should load. If a new missing package appears, treat it as the next first blocker.

When Wonderful Launcher Is the Better Next Step

Manual package repair works when there is one clear missing import. It becomes risky when:

  • several custom nodes fail at startup
  • pip check reports conflicts after each install
  • CUDA or Torch changed while fixing a plugin
  • you are not sure which Python launched ComfyUI
  • the workflow matters and you need to preserve models and settings

Still stuck after the manual fix?

Preserve the environment, collect the startup log, and use Wonderful Launcher diagnostics as the next step instead of trying random package installs.

Open diagnostics path

Related Guides

  • ComfyUI Dependency Conflicts
  • How to Fix ComfyUI Plugin Import Failed Errors
  • ComfyUI Python Embedded Explained
  • Install Custom Nodes Safely
  • Where to Put Safetensors in ComfyUI

You can fix it manually, or download Wonderful Launcher for Windows to diagnose plugin errors, missing dependencies, and broken ComfyUI environments without reinstalling.

Download free for Windows
Keep reading:Find the Python that launches ComfyUIFix custom node import failuresRepair dependency conflicts

You can fix it manually, or download Wonderful Launcher for Windows to diagnose plugin errors, missing dependencies, and broken ComfyUI environments without reinstalling.

Download free for Windows

Did this fix your issue?

Your answer helps prioritize verified ComfyUI repairs.

ComfyUI Common Issues and Fast Fixes

Fast fixes for common ComfyUI problems — CUDA errors, red nodes, missing models, prompt has no outputs, slow generation, and reconnecting.

ComfyUI Dependency Conflicts: Fix Without Reinstalling

Fix ComfyUI dependency conflicts after custom node installs, Torch downgrades, pip clashes, or broken plugin imports without destroying a working environment.

Table of Contents

Fast Diagnosis
Step 1: Copy the Exact Missing Module
Step 2: Find the Python That Starts ComfyUI
Step 3: Decide Whether the Missing Package Is Fatal
Step 4: Install the Specific Fix
Step 5: Verify the Repair
When Wonderful Launcher Is the Better Next Step
Related Guides