ComfyUI MMCV Install Failed: pip install mmcv exited with code 1
Fix mmcv, mmcv-lite, and OpenMMLab wheel failures in ComfyUI without breaking Torch, CUDA, or OpenCV.
If you searched for pip install mmcv exited with code 1, failed to build mmcv, No module named 'mmcv', or No module named 'mmcv._ext', the short answer is this:
do not keep retrying a plain pip install mmcv from a random terminal. MMCV must match the Python, PyTorch, CUDA, and OpenMMLab stack that your ComfyUI process actually uses.
Common Error Messages
You may see one of these:
pip install mmcv exited with code 1ERROR: Failed building wheel for mmcvModuleNotFoundError: No module named 'mmcv'ModuleNotFoundError: No module named 'mmcv._ext'or a pip check warning:
mmcv requires opencv-python, which is not installedThese messages do not all mean the same thing. No module named 'mmcv' means the package is missing. No module named 'mmcv._ext' usually means the plugin expected MMCV's compiled ops, not just the lite Python package.
Why MMCV Fails in ComfyUI
MMCV is part of the OpenMMLab computer vision ecosystem. Some ComfyUI custom nodes pull it indirectly for detection, segmentation, pose, or video helper workflows.
The difficult part is that MMCV has two package families:
| Package | What It Contains | Practical Meaning in ComfyUI |
|---|---|---|
mmcv | Full MMCV with compiled CPU/CUDA ops | Needed when a plugin imports mmcv.ops or mmcv._ext |
mmcv-lite | Python-side MMCV without CUDA ops | Enough only when the plugin does not need compiled ops |
OpenMMLab's own installation docs warn not to install both versions in the same environment. In ComfyUI, mixing them can make the import state harder to reason about.
First Decide If MMCV Is Actually Blocking You
MMCV is not a core ComfyUI dependency. Fix it only when:
- the startup log shows an
IMPORT FAILEDfor a plugin you need - the workflow has red nodes from a plugin that depends on MMCV
- the traceback names
mmcv,mmcv.ops, ormmcv._ext
If ComfyUI starts, the plugin you need imports, and the workflow runs, a stray pip check warning is not automatically worth changing the environment for.
Step 1: Use the Correct Python
Plain pip install often targets the wrong Python. Run checks with the same Python that starts ComfyUI.
| Install type | Check command |
|---|---|
| Official GitHub Windows portable package | From the portable package root: .\python_embeded\python.exe -s -c "import torch; print(torch.__version__, torch.version.cuda)" |
| Manual Git + venv install | Activate the venv, then run python -c "import torch; print(torch.__version__, torch.version.cuda)" |
| ComfyUI Desktop or managed launcher | Use the app's environment or terminal tooling instead of assuming a portable python_embeded folder |
Record:
- Python version
- PyTorch version
- CUDA version reported by PyTorch
- whether the plugin needs
mmcv._ext
Step 2: Remove Mixed MMCV Installs
If both packages are installed, clean them before choosing one path:
python -m pip uninstall -y mmcv mmcv-liteFor the official Windows portable package:
.\python_embeded\python.exe -s -m pip uninstall -y mmcv mmcv-liteThen restart ComfyUI only after installing the package you actually need.
Step 3: Choose Lite or Full MMCV
Case 1: The plugin only needs import mmcv
Try mmcv-lite first:
python -m pip install mmcv-lite
python -c "import mmcv; print(mmcv.__version__)"For the official Windows portable package:
.\python_embeded\python.exe -s -m pip install mmcv-lite
.\python_embeded\python.exe -s -c "import mmcv; print(mmcv.__version__)"This is the lower-risk path when the custom node does not need MMCV CUDA operators.
Case 2: The error names mmcv._ext or mmcv.ops
mmcv-lite is not enough. You need full MMCV built for a compatible Python, PyTorch, and CUDA combination.
OpenMMLab recommends using openmim for MMCV installation:
python -m pip install -U openmim
mim install "mmcv>=2.0.0rc1"For the official Windows portable package, make sure the mim executable comes from the embedded Python environment:
.\python_embeded\python.exe -s -m pip install -U openmim
.\python_embeded\Scripts\mim.exe install "mmcv>=2.0.0rc1"Watch the install log. If it downloads a .whl, you found a prebuilt wheel. If it downloads a .tar.gz and starts compiling, there may be no matching prebuilt wheel for your combination. On Windows, forcing a source build can fail or take a long time.
Step 4: Handle OpenCV Separately
If the only remaining line is:
mmcv requires opencv-python, which is not installeddo not stack several OpenCV packages to satisfy every warning. Install one OpenCV flavor and verify cv2:
python -m pip install opencv-python-headless
python -c "import cv2; print(cv2.__version__)"Use the OpenCV guide if your environment already has multiple OpenCV packages or a NumPy/OpenCV import conflict.
Verify the Repair
Check the package import:
python -c "import mmcv; print(mmcv.__version__)"If your plugin needs compiled ops, also check:
python -c "import mmcv.ops; print('mmcv ops available')"Then restart ComfyUI and check:
http://127.0.0.1:8188/v2/customnode/import_fail_info_bulkIf the same plugin still appears there, read the next traceback. MMCV may have been only the first missing layer.
When to Stop
Stop and reconsider before doing any of these:
- downgrading PyTorch just to satisfy MMCV
- installing both
mmcvandmmcv-lite - installing Visual Studio Build Tools only because
pipfell back to a source build - changing NumPy, OpenCV, and Torch in one command
- repairing MMCV when the workflow you use does not need that plugin
For multi-plugin environments, it is often safer to isolate the MMCV workflow or recover the environment through Wonderful Launcher than to keep broad package changes in the main ComfyUI install.
Related Guides
- ComfyUI Dependency Conflicts
- OpenCV (cv2) Missing or Conflicting
- How to Fix ComfyUI Plugin Import Failed Errors
- Workflow Environment Setup
Source References
OpenCV (cv2) Missing or Conflicting
Fix No module named cv2, missing opencv-python-headless, opencv-contrib-python, and OpenCV package conflicts in ComfyUI.
Wonderful Launcher Startup Failed? Fix Missing Bootstrapper Errors
Fix the "ModelFinder.Bootstrapper.exe not found" startup error in Wonderful Launcher.
Wonderful Launcher Docs