ComfyUI: ModuleNotFoundError: No module named 'aiohttp' (fix)
ModuleNotFoundError: No module named 'aiohttp' 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 aiohttp:
python main.py
Traceback (most recent call last):
File "/path/to/ComfyUI/main.py", line 27, in <module>
from app.assets.manager import AssetManager, default_asset_manager
File "/path/to/ComfyUI/app/assets/manager.py", line 4, in <module>
from aiohttp import web
ModuleNotFoundError: No module named 'aiohttp'
ComfyUI exited with code 1 before loading any nodes: main.py line 27 imports app/assets/manager.py, which does from aiohttp import web at line 4. aiohttp is the web framework ComfyUI's server and UI run on, and it is listed in requirements.txt (aiohttp>=3.11.8), 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 aiohttp>=3.11.8 (from -r requirements.txt (line 14))
Downloading aiohttp-3.14.5-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (8.3 kB)
Downloading aiohttp-3.14.5-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.9 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.9/1.9 MB 15.1 MB/s 0:00:00
Installing collected packages: aiohttp
Successfully installed aiohttp-3.14.5
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 aiohttp 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 'einops' · ComfyUI: No module named 'safetensors' · ComfyUI: No module named 'transformers' · ComfyUI: No module named 'requests' · ComfyUI: No module named 'sqlalchemy'
Frequently asked questions
Is aiohttp required by ComfyUI?
Yes. It is in requirements.txt (aiohttp>=3.11.8), ComfyUI's web server runs on it, and main.py imports it during startup, so ComfyUI exits with code 1 without it.
I installed aiohttp 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 aiohttp and after pip install -r requirements.txt (aiohttp 3.14.5). Output pasted unedited except shortened paths and omitted already-satisfied lines. PlainTables is our extension; ComfyUI and aiohttp are free.