ComfyUI: No module named 'numpy' or 'numpy.dtypes' (fix)
ModuleNotFoundError: No module named 'numpy' or No module named 'numpy.dtypes' stops ComfyUI at startup, before any model or custom node loads. We reproduced both on ComfyUI v0.37.0 and fixed them.
1. No module named 'numpy'
ComfyUI v0.37.0 started in a venv where everything from requirements.txt is installed except NumPy:
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 28, in <module>
import numpy as np
ModuleNotFoundError: No module named 'numpy'
ComfyUI exited with code 1 before loading any nodes: main.py line 249 imports comfy/utils.py, which does import numpy as np at line 28. NumPy is in ComfyUI's requirements.txt (numpy>=1.25.0), so seeing it missing usually means the requirements were never installed into the Python that runs ComfyUI, or something uninstalled it.
2. No module named 'numpy.dtypes': NumPy is too old
The same file imports numpy.dtypes further down. That module first appeared in NumPy 1.25.0, which is why requirements.txt asks for numpy>=1.25.0. We downgraded to NumPy 1.24.4 (what an old custom node pin can do to you); pip warned but installed it:
python -m pip install numpy==1.24.4
matplotlib 3.11.2 requires numpy>=1.25, but you have numpy 1.24.4 which is incompatible.
ml-dtypes 0.6.0 requires numpy>=2.0.0, but you have numpy 1.24.4 which is incompatible.
Successfully installed numpy-1.24.4
ComfyUI then stopped at comfy/utils.py line 55, again with exit code 1:
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 55, in <module>
from numpy.dtypes import Float64DType
ModuleNotFoundError: No module named 'numpy.dtypes'
3. Fix both: 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 numpy>=1.25.0 (from -r requirements.txt (line 8))
Downloading numpy-2.4.6-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.metadata (6.6 kB)
Downloading numpy-2.4.6-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (16.9 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16.9/16.9 MB 33.7 MB/s 0:00:00
Installing collected packages: numpy
Attempting uninstall: numpy
Found existing installation: numpy 1.24.4
Uninstalling numpy-1.24.4:
Successfully uninstalled numpy-1.24.4
Successfully installed numpy-2.4.6
(pip also printed a dependency warning about unrelated custom node packages in our test venv; we left it out.) pip replaced 1.24.4 with NumPy 2.4.6, and 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 a custom node's requirements keep pulling NumPy back below 1.25, that node is the conflict: update it, or install its requirements first and ComfyUI's last. If you hit the opposite problem (an old compiled extension failing on NumPy 2), see A module that was compiled using NumPy 1.x cannot be run in NumPy 2.
If pip says NumPy 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 'PIL' · ComfyUI: No module named 'aiohttp' · 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
What causes No module named 'numpy.dtypes' in ComfyUI?
NumPy older than 1.25. The numpy.dtypes module was added in 1.25.0 and comfy/utils.py imports it at startup; install requirements.txt to get numpy>=1.25.0.
Is NumPy 2 OK for ComfyUI?
Yes. ComfyUI v0.37.0 started and loaded all nodes with NumPy 2.4.6 in our test.
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 NumPy, with NumPy 1.24.4, and after pip install -r requirements.txt (NumPy 2.4.6). Output pasted unedited except shortened paths, omitted already-satisfied lines and one omitted pip warning. PlainTables is our extension; ComfyUI and NumPy are free.