ComfyUI-Manager: ModuleNotFoundError: No module named 'comfy' (fix)
ModuleNotFoundError: No module named 'comfy' from ComfyUI-Manager means Manager code ran in a Python process that cannot see your ComfyUI folder. We reproduced it with comfyui_manager 4.2.2 and fixed it three ways.
1. The error
ComfyUI-Manager 4.x is a pip package (comfyui_manager, version 4.2.2 here). Importing it from a Python process that is not running inside the ComfyUI folder:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "venv/lib/python3.11/site-packages/comfyui_manager/__init__.py", line 6, in <module>
from comfy.cli_args import args
ModuleNotFoundError: No module named 'comfy'
Line 6 of the package's __init__.py is from comfy.cli_args import args. comfy is not something pip installs: it is the comfy/ folder inside your ComfyUI checkout. Python only finds it when that folder is on sys.path. Running python main.py puts the ComfyUI folder there automatically (we also ran main.py from a different working directory and it still started), so the error comes from starting Manager code some other way: a standalone script, python -c, a notebook, or a tool that imports comfyui_manager outside ComfyUI. The same import comfyui_manager worked when run from the ComfyUI folder and when PYTHONPATH pointed at it.
2. Fix: let ComfyUI load Manager
Recent ComfyUI (v0.37.0 here) ships a manager_requirements.txt (here pinning comfyui_manager==4.2.2) and loads Manager itself with a flag. Without the package installed, python main.py --enable-manager printed:
[WARNING]
To use the `--enable-manager` feature, the `comfyui-manager` package must be installed first.
command:
venv/bin/python -m pip install -r ComfyUI/manager_requirements.txt
Run that command with the Python that runs main.py, then start ComfyUI with --enable-manager again:
cd ComfyUI
python -m pip install -r manager_requirements.txt
python main.py --enable-manager
[INFO] [START] ComfyUI-Manager
[ComfyUI-Manager] Using GitPython backend
[INFO] [ComfyUI-Manager] network_mode: public
[INFO] [ComfyUI-Manager] All startup tasks have been completed.
3. cm-cli: set COMFYUI_PATH
The package also installs a cm-cli command. Without the environment variable it stops with:
cm-cli: environment variable 'COMFYUI_PATH' is not specified.
cm-cli appends COMFYUI_PATH to sys.path, which is how it finds comfy. Point it at the ComfyUI folder (the one containing main.py):
COMFYUI_PATH=/path/to/ComfyUI cm-cli show installed
FETCH DATA from: ComfyUI/user/__manager/cache/1514988643_custom-node-list.json [DONE]
FETCH DATA from: ComfyUI/user/__manager/cache/1514988643_custom-node-list.json [DONE]
[ ENABLED ] ComfyUI InstantID (Native Support)
ComfyUI_InstantID (author: cubiq ) [UNKNOWN]
[ ENABLED ] ComfyUI-GGUF
ComfyUI-GGUF (author: city96 ) [UNKNOWN]
On Windows: set COMFYUI_PATH=C:\path\to\ComfyUI first. One more trap: comfyui_manager 4.2.2 imports aiohttp but does not list it as a dependency, so in a fresh venv without ComfyUI's own requirements cm-cli failed one step earlier:
Traceback (most recent call last):
File "venv/bin/cm-cli", line 10, in <module>
sys.exit(main())
^^^^^^
File "venv/lib/python3.11/site-packages/cm_cli/__init__.py", line 2, in main
from .__main__ import main as _main
File "venv/lib/python3.11/site-packages/cm_cli/__main__.py", line 35, in <module>
from comfyui_manager.common import manager_util
File "venv/lib/python3.11/site-packages/comfyui_manager/__init__.py", line 3, in <module>
from aiohttp import web
ModuleNotFoundError: No module named 'aiohttp'
Installing into the same venv as ComfyUI avoids that (aiohttp is in ComfyUI's requirements.txt); otherwise pip install aiohttp.
Related: ComfyUI-Manager: No module named 'git' · ComfyUI-Manager: No module named 'toml' · cm-cli.py: No module named 'utils' (git-clone Manager) · ComfyUI-Manager: Bad git executable · ComfyUI: No module named 'insightface' · ComfyUI: No module named 'av'
Frequently asked questions
Can I pip install comfy?
No. comfy is the comfy/ folder inside ComfyUI itself; it becomes importable when ComfyUI runs, when you run from the ComfyUI folder, or via PYTHONPATH/COMFYUI_PATH.
How do I enable the new ComfyUI-Manager?
Install manager_requirements.txt with ComfyUI's Python, then start python main.py --enable-manager.
Written with AI assistance. Measured on 2026-10-24 on Linux, CPython 3.11.17: ComfyUI v0.37.0, comfyui_manager 4.2.2 from PyPI (with and without ComfyUI on sys.path), cm-cli with and without COMFYUI_PATH. Output pasted unedited except shortened paths. PlainTables is our extension; ComfyUI and ComfyUI-Manager are free.