ComfyUI-Manager cm-cli: ModuleNotFoundError: No module named 'utils' (fix)

ModuleNotFoundError: No module named 'utils' from ComfyUI-Manager's cm-cli.py means it could not find your ComfyUI folder. We reproduced it with a Manager clone outside custom_nodes and fixed it two ways, plus the related 'utils.extra_config' variant.

1. The error

The git-clone version of ComfyUI-Manager (commit 7e1af9c here) ships cm-cli.py. Run from a Manager folder that is not inside ComfyUI/custom_nodes/, without COMFYUI_PATH set:

python /path/to/ComfyUI-Manager/cm-cli.py show installed
WARN: The `COMFYUI_PATH` environment variable is not set. Assuming 
`custom_nodes/ComfyUI-Manager/../../` as the ComfyUI path.
Traceback (most recent call last):
  File "/path/to/ComfyUI-Manager/cm-cli.py", line 38, in <module>
    import utils.extra_config
ModuleNotFoundError: No module named 'utils'

Line 38 is import utils.extra_config. That utils is not a pip package: it is the utils/ folder inside your ComfyUI checkout (next to main.py). cm-cli.py works out where ComfyUI is in this order: the COMFYUI_PATH environment variable, then an importable folder_paths, then a guess of two folders above itself (custom_nodes/ComfyUI-Manager/../../). It appends that path to sys.path. When Manager is cloned anywhere else the guess points at the wrong folder, so the import fails right after the WARN line.

2. Fix: set COMFYUI_PATH

Point it at the folder that contains main.py, and run it with the same Python (venv) that runs ComfyUI:

COMFYUI_PATH=/path/to/ComfyUI python /path/to/ComfyUI-Manager/cm-cli.py show installed
Cannot connect to comfyregistry.
FETCH DATA from: /path/to/ComfyUI/user/__manager/cache/1514988643_custom-node-list.json [DONE]
FETCH DATA from: /path/to/ComfyUI/user/__manager/cache/1514988643_custom-node-list.json [DONE]
[    ENABLED    ]  ComfyUI InstantID (Native Support)                 
ComfyUI_InstantID              (author: cubiq               ) [UNKNOWN]
[    ENABLED    ]  Various ComfyUI Nodes by Type                      
comfyui-various                (author: jamesWalker55       ) [UNKNOWN]
[    ENABLED    ]  ComfyUI Impact Subpack                             
ComfyUI-Impact-Subpack         (author: Dr.Lt.Data          ) [UNKNOWN]
[    ENABLED    ]  ComfyUI-GGUF                                       
ComfyUI-GGUF                   (author: city96              ) [UNKNOWN]

(Our test machine could not reach the Comfy registry, so Manager fell back to its cached node list; the four installed node packs were listed.) On Windows run set COMFYUI_PATH=C:\path\to\ComfyUI first.

3. Or keep Manager in custom_nodes

With the same clone placed at ComfyUI/custom_nodes/ComfyUI-Manager, no variable was needed: the WARN still prints, but the guess is now correct and the command works:

WARN: The `COMFYUI_PATH` environment variable is not set. Assuming 
`custom_nodes/ComfyUI-Manager/../../` as the ComfyUI path.
Cannot connect to comfyregistry.
FETCH DATA from: /path/to/ComfyUI/user/__manager/cache/1514988643_custom-node-list.json [DONE]
FETCH DATA from: /path/to/ComfyUI/user/__manager/cache/1514988643_custom-node-list.json [DONE]
[    ENABLED    ]  ComfyUI InstantID (Native Support)                 
ComfyUI_InstantID              (author: cubiq               ) [UNKNOWN]
[    ENABLED    ]  ComfyUI-Manager                                    
ComfyUI-Manager                (author: Dr.Lt.Data          ) [UNKNOWN]
[    ENABLED    ]  Various ComfyUI Nodes by Type                      
comfyui-various                (author: jamesWalker55       ) [UNKNOWN]
[    ENABLED    ]  ComfyUI Impact Subpack                             
ComfyUI-Impact-Subpack         (author: Dr.Lt.Data          ) [UNKNOWN]
[    ENABLED    ]  ComfyUI-GGUF                                       
ComfyUI-GGUF                   (author: city96              ) [UNKNOWN]

4. No module named 'utils.extra_config'

A different message means a different cause. cm-cli.py appends the ComfyUI path to sys.path, so site-packages are searched first. If an unrelated package named utils is installed in that venv (we installed utils 1.0.2 from PyPI), it wins even with COMFYUI_PATH set correctly:

Traceback (most recent call last):
  File "/path/to/ComfyUI-Manager/cm-cli.py", line 38, in <module>
    import utils.extra_config
ModuleNotFoundError: No module named 'utils.extra_config'

Check with python -c "import utils; print(utils.__file__)": if the path is in site-packages instead of your ComfyUI folder, remove that package:

python -m pip uninstall utils

After uninstalling it, the same COMFYUI_PATH=... cm-cli.py show installed listed all four node packs again.

Related: ComfyUI-Manager: No module named 'comfy' (the pip-installed Manager 4.x and its cm-cli command) · ComfyUI-Manager: Bad git executable · ComfyUI: No module named 'comfy.options'

Frequently asked questions

Can I pip install utils to fix cm-cli?

No. The utils it needs is the utils/ folder inside ComfyUI. Installing the PyPI utils package makes it worse: cm-cli then fails with No module named 'utils.extra_config'.

Where should COMFYUI_PATH point?

At the ComfyUI folder that contains main.py (and the utils/ and custom_nodes/ folders).

Written with AI assistance. Measured on 2026-10-24 on Linux, CPython 3.11.17: ComfyUI v0.37.0, ComfyUI-Manager git clone @7e1af9c, cm-cli.py outside and inside custom_nodes, with and without COMFYUI_PATH, and with PyPI utils 1.0.2 installed. Output pasted unedited except shortened paths. PlainTables is our extension; ComfyUI and ComfyUI-Manager are free.