No module named … (missing Python package for custom node)
A custom node needs a Python package that is not installed in ComfyUI’s Python environment.
The message
ModuleNotFoundError: No module named 'xyz'
Affects: ComfyUI
Why is this happening?
Custom nodes include a requirements.txt whose packages are automatically installed during installation via the ComfyUI Manager. If you copied the node by hand (git clone or ZIP), the installation failed, or the packages were installed into a different Python, they are missing. With Portable, it is very common to accidentally use the system Python instead of python_embeded.
How to fix it
- Read the console window to see which custom node is causing the error (the path is in the error message, for example
custom_nodes\ComfyUI-XYZ). - The easiest way: Open the ComfyUI Manager, find the node, update it or reinstall it, and restart ComfyUI. The Manager installs the
requirements.txtautomatically. - Portable, by hand: Open a terminal in the
ComfyUI_windows_portablefolder (right-click in the empty folder area → “Open in Terminal”). Run.\python_embeded\python.exe -m pip install -r ComfyUI\custom_nodes\ComfyUI-XYZ\requirements.txt(adjust the folder names). - Manual installation: activate the venv (
comfyui_env\Scripts\activate) and runpip install -r custom_nodes\ComfyUI-XYZ\requirements.txt. - Desktop app: Open Manage → Terminal. The terminal starts in the instance folder; run the pip command there.
- After that, check with the torch version command that PyTorch is still the CUDA version (see the entry “CUDA gone after installing a custom node”).
Better not: Do not install packages with a plain pip install in some random window. That ends up in the wrong Python, and ComfyUI won’t see it.
Set up from scratch again
If it still doesn’t work after that, a fresh setup step by step often helps:
- Set up and maintain ComfyUI on Windows
Desktop or Portable, where the models belong, sharing models with other programs, safely installing custom nodes, updates, startup options … - Your First Image with ComfyUI
Install Comfy Desktop, learn the interface, and create your first AI image with FLUX.2 [small] 4B or Z-Image Turbo. - Your First AI Video with LTX in ComfyUI
Use LTX-2.3 in ComfyUI to create short videos with sound from text or an image. Template, files, settings, and license.
Terms for this
Similar errors
- Failed building wheel for insightface (insightface for ReActor/IPAdapter FaceID won’t install)
- ffmpeg is required for video outputs and could not be found (Video Combine cannot save a video)
- A module that was compiled using NumPy 1.x cannot be run in NumPy 2.x – a package does not match the installed NumPy version
- Custom Node: IMPORT FAILED
- ImportError: DLL load failed while importing …: The specified module could not be found – a Python package is missing a Windows DLL
Sources
- https://docs.comfy.org/installation/comfyui_portable_windows
- https://github.com/Comfy-Org/ComfyUI-Manager/blob/main/README.md
- https://docs.comfy.org/troubleshooting/custom-node-issues
- https://docs.comfy.org/troubleshooting/overview
- https://docs.comfy.org/installation/desktop/usage/manage
Checked on Oct 21, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.