LogoWonderful Launcher
  • Home
  • Pricing
  • Docs
  • Download

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-07-11Estimated 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.

When ComfyUI prints ModuleNotFoundError: No module named ..., this hub routes you to the exact fix. The missing package is only half the diagnosis — the more important question is which Python environment launched ComfyUI.

For the official Windows portable package, run package commands 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 'triton'Telemetry hotspotNo module named 'sageattention'Telemetry hotspotNo module named 'onnx' or 'onnxruntime'Telemetry hotspotNo module named 'llama_cpp'Telemetry hotspotNo module named 'nunchaku'Telemetry hotspotNo module named 'cv2'Partially verifiedNo module named 'kornia'SEO Lab verifiedNo module named 'yaml'Package-name trapNo module named 'PIL'Package-name trapNo module named 'pydantic_settings'SEO Lab verifiedNo module named 'spandrel'SEO Lab verifiedNo module named 'simpleeval'SEO Lab verifiedNo module named 'safetensors'SEO Lab verifiedNo module named 'einops'SEO Lab verifiedNo module named 'scipy'SEO Lab verifiedNo module named 'torchsde'SEO Lab verifiedNo module named 'av'SEO Lab verifiedNo module named 'aiohttp'SEO Lab verifiedNo module named 'requests'SEO Lab verifiedNo module named 'insightface'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 nextContinue with the new first traceback
CUDA, DLL, or wheel errors appearPackage has native or GPU dependenciesCheck Torch/CUDA before changing more packages

Route to the exact fix

Missing moduleWhere it usually appearsBest next page
tritonFLUX, acceleration stacks, mixed plugin/runtime environmentsFix triton
sageattentionPerformance-oriented workflows and acceleration pluginsFix sageattention
onnx / onnxruntimeFace, pose, upscaling, and ONNX-backed nodesFix onnx and onnxruntime
llama_cppLLM or prompt-helper custom nodesFix llama_cpp
groundingdino / segment_anythingDetection, segmentation, and grounding workflowsFix SAM/GroundingDINO imports
insightfaceFace swap, face analysis, identity workflowsFix insightface
cv2OpenCV-dependent image and video nodesFix cv2
nunchaku (and nunchaku.lora / nunchaku.models)Nunchaku quantized FLUX/Qwen/SANA workflowsFix nunchaku
korniaBuilt-in post-processing, canny, and morphology nodesFix kornia
spandrelUpscale model nodes and nodes_upscale_model.pyFix spandrel
simpleevalMath expression nodes and nodes_math.pyFix simpleeval
pydantic_settingspyproject.toml parsing and settings importsFix pydantic_settings
yaml / PILPackage-name traps: install PyYAML / PillowFix yaml or fix PIL
safetensorsPython package for reading safetensors filesFix the safetensors package
einopsCore tensor/model utilities and ML custom nodesFix einops
scipyScientific Python stack, audio/video/model utilitiesFix scipy
torchsdePyTorch-adjacent sampler/model stackFix torchsde
avPyAV media/video dependencyFix av
aiohttp / requestsServer and HTTP client dependenciesFix aiohttp or fix requests

If the missing module is not listed (for example argostranslate, flash_attn, dlib, soundfile, timm, nvvfx, decord, hydra), repair the custom node that imports it rather than installing a package by guessing its name.

No OpenGL_accelerate module loaded is usually not a startup failure

No OpenGL_accelerate module loaded: No module named 'OpenGL_accelerate'

OpenGL_accelerate comes from PyOpenGL-accelerate, an optional performance companion for PyOpenGL. If the same log later shows Starting server and To see the GUI go to: http://127.0.0.1:..., ComfyUI started — do not install packages just to remove this warning. Install PyOpenGL-accelerate (into ComfyUI's Python) only when a named feature or traceback requires it. This is not the same as RuntimeError: OpenGL dependencies not available from nodes_glsl.py; for that, follow the OpenGL dependency guide.

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 comes from an OpenCV package, and segment_anything from segment-anything).

Step 2: Find the Python that starts ComfyUI

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

For manual venv installs, use python -m pip .... The output path should point into the same ComfyUI environment; if it points to system Python, the repair is in the wrong place.

Step 3: Decide whether the missing package is fatal

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

Where the traceback starts changes the repair path: ComfyUI\comfy\... or bootstrap files mean a core dependency drifted (pair with Startup Failed); custom_nodes\<plugin>\... means repair that plugin only (pair with plugin import failures); a launcher deployment step means an install/bootstrap issue.

Step 4: Package name, pip command, or requirements file?

When a guide or repair tool asks for a package name, do not paste a whole shell command:

You haveWhat it isSafer handling
onnxruntimeA package specInstall it with the Python that starts ComfyUI
pip install onnxruntimeA shell commandRun it in a terminal for the correct Python, or copy just onnxruntime into a package field
python -m pip install onnxruntimeA Python/pip commandUse it as a command, not a package name
requirements.txtA dependency fileInstall with pip install -r requirements.txt, not as a package named requirements.txt
custom_nodes/MyNode/requirements.txtA plugin dependency fileInstall only for that plugin, then restart and check its import

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

Step 5: Verify the repair

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

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

Stop and re-check before installing anything if the missing module changed after each restart, the install succeeded but the same name still fails, you are mixing system Python and python_embeded, Torch/CUDA/DLL errors appeared at the same time, or more than one plugin started failing after a single install. That pattern usually means the environment drifted, not that one package is missing in isolation.

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

Source References

  • ComfyUI troubleshooting overview
  • ComfyUI custom node troubleshooting guide
  • PyOpenGL-accelerate project description
Related guides:Find the Python that launches ComfyUIFix custom node import failuresRepair dependency conflicts

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 packages

Did this fix your issue?

Your answer helps prioritize verified ComfyUI repairs.

Table of Contents

Fast diagnosis
Route to the exact fix
No OpenGL_accelerate module loaded is usually not a startup failure
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: Package name, pip command, or requirements file?
Step 5: Verify the repair
Related Guides
Source References