ComfyUI: ModuleNotFoundError: No module named 'comfy.options' (fix)
ModuleNotFoundError: No module named 'comfy.options' at line 1 of ComfyUI's main.py happens when an unrelated comfy package from PyPI is installed in the same Python. We reproduced it on v0.37.0 and show the one-line check and fix.
1. The error
ComfyUI v0.37.0 (CPython 3.11, torch 2.9.0+cpu), started from its own folder, in a venv where someone also ran pip install comfy:
$ python main.py
Traceback (most recent call last):
File "ComfyUI/main.py", line 1, in <module>
import comfy.options
ModuleNotFoundError: No module named 'comfy.options'
The ComfyUI folder clearly contains comfy/options.py, and the same install started fine a minute earlier. What changed is that comfy on PyPI is an unrelated package (version 0.0.1, "Formal view for configurations and command line options"), and it took over the name.
2. Why the PyPI package wins
ComfyUI's comfy/ folder has no __init__.py, so Python treats it as a namespace package. During import, a regular package (one with __init__.py) anywhere on sys.path beats a namespace package, even one in the script's own folder that comes first. The PyPI comfy has an __init__.py in site-packages, so import comfy resolves to it, and it has no options submodule. Check which one you get, from the ComfyUI folder:
$ python -c "import comfy; print(comfy.__file__)"
venv/lib/python3.11/site-packages/comfy/__init__.py
$ python -m pip show comfy
Name: comfy
Version: 0.0.1
Summary: Formal view for configurations and command line options
Location: venv/lib/python3.11/site-packages
If comfy.__file__ points into site-packages, that is the cause. The same shadowing breaks anything else that imports from comfy, e.g. importing ComfyUI-Manager 4.2.2 in a venv with the PyPI package raised No module named 'comfy.cli_args'.
3. Fix: uninstall the unrelated package
$ python -m pip uninstall -y comfy
Found existing installation: comfy 0.0.1
Uninstalling comfy-0.0.1:
Successfully uninstalled comfy-0.0.1
$ python -c "import comfy; print(comfy.__path__)"
_NamespacePath(['ComfyUI/comfy'])
A _NamespacePath pointing at your ComfyUI folder is the healthy result. After the uninstall, python main.py --cpu --quick-test-for-ci exited with code 0 again. Use the same Python that runs ComfyUI (python_embeded\python.exe -m pip uninstall comfy on the Windows portable build). ComfyUI itself is not installed with pip install comfy; for the official CLI the package is comfy-cli.
Related: ComfyUI-Manager: No module named 'comfy' · ComfyUI: No module named 'yaml' (wrong Python) · ComfyUI: No module named 'av'
Frequently asked questions
Why does pip install comfy break ComfyUI?
PyPI's comfy 0.0.1 is a different project. Because ComfyUI's comfy folder has no __init__.py, the installed regular package wins the import and has no comfy.options.
How do I check?
From the ComfyUI folder run python -c "import comfy; print(comfy.__file__)". A path in site-packages means the PyPI package is shadowing ComfyUI.
Written with AI assistance. Measured on 2026-10-24 on Linux, CPython 3.11.17: ComfyUI v0.37.0, torch 2.9.0+cpu, with and without comfy 0.0.1 from PyPI installed in the same venv. Output pasted unedited except shortened paths. PlainTables is our extension; ComfyUI is free.