ComfyUI: ModuleNotFoundError: No module named 'einops' (fix)

ModuleNotFoundError: No module named 'einops' stops ComfyUI at startup, before any model or custom node loads. We reproduced it on ComfyUI v0.37.0 and fixed it.

1. The error

ComfyUI v0.37.0 started in a venv where everything from requirements.txt is installed except einops:

python main.py
Traceback (most recent call last):
  File "/path/to/ComfyUI/main.py", line 249, in <module>
    import comfy.utils
  File "/path/to/ComfyUI/comfy/utils.py", line 34, in <module>
    from einops import rearrange
ModuleNotFoundError: No module named 'einops'

ComfyUI exited with code 1 before loading any nodes: main.py line 249 imports comfy/utils.py, which does from einops import rearrange at line 34 (einops is used for tensor reshaping throughout the model code). einops is listed in ComfyUI's requirements.txt (spandrel depends on it too), so seeing it missing usually means the requirements were never installed into the Python that runs ComfyUI, or something uninstalled it.

2. Fix: install requirements.txt with the same Python

From the ComfyUI folder, using the Python that starts ComfyUI (your venv's python; in the Windows portable build, ..\python_embeded\python.exe run from inside the ComfyUI folder):

python -m pip install -r requirements.txt
Collecting einops (from -r requirements.txt (line 9))
  Using cached einops-0.8.2-py3-none-any.whl.metadata (13 kB)
Using cached einops-0.8.2-py3-none-any.whl (65 kB)
Installing collected packages: einops
Successfully installed einops-0.8.2

(pip also printed a dependency warning about packages of unrelated custom nodes in our test venv; we left it out.) Started again, ComfyUI loaded all nodes and exited 0 (--quick-test-for-ci):

[INFO] Context impl SQLiteImpl.
[INFO] Will assume non-transactional DDL.
[INFO] Using RAM pressure cache.

If pip says einops is already installed and the error stays, you are installing into a different Python than the one running ComfyUI. See ComfyUI: No module named 'yaml' for how to find the right one.

Related: ComfyUI: No module named 'safetensors' · ComfyUI: No module named 'transformers' · ComfyUI: No module named 'requests' · ComfyUI: No module named 'sqlalchemy'

Frequently asked questions

Is einops required by ComfyUI?

Yes. It is in requirements.txt and comfy/utils.py imports it during startup, so ComfyUI exits with code 1 without it.

I installed einops but still get the error. Why?

It went into a different Python. Run python -m pip with the same python (or python_embeded\python.exe) that starts ComfyUI.

Written with AI assistance. Measured on 2026-10-24 on Linux, CPython 3.11.17, pip 26.2.2: ComfyUI v0.37.0 with torch 2.9.0+cpu, without einops and after pip install -r requirements.txt (einops 0.8.2). Output pasted unedited except shortened paths and one omitted pip warning. PlainTables is our extension; ComfyUI and einops are free.