A module that was compiled using NumPy 1.x cannot be run in NumPy 2.x – a package does not match the installed NumPy version
A package was built for NumPy 1.x, but NumPy 2.x is installed in your environment.
The message
A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.0 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. … AttributeError: _ARRAY_API not found
Affects: Python, ComfyUI, AUTOMATIC1111 Stable Diffusion WebUI, Stable Diffusion WebUI Forge
Why is this happening?
NumPy 2.0 changed the internal interface for compiled packages. Packages built against NumPy 1.x no longer work with NumPy 2; the other way around does work. Usually, another package or extension installed NumPy 2 at the same time, while an older package like OpenCV (cv2) still expects the old version. An ImportError often follows right after that, and the package does not load at all.
How to fix it
- Check the traceback above the message to see which import fails (for example
import cv2). That is the package that was still built for NumPy 1.x. - Check the installed NumPy version in the program's environment:
python -m pip show numpy. For ComfyUI portable in the ComfyUI folder:.\python_embeded\python.exe -m pip show numpy. - Better first: Update the affected package to a version built for NumPy 2, for example
python -m pip install --upgrade opencv-python(use the package name from step 1). - If there is no suitable new version, downgrade NumPy to below version 2, as the message itself suggests:
python -m pip install "numpy<2". For ComfyUI portable:.\python_embeded\python.exe -m pip install "numpy<2". - Restart the program and check whether the message is gone.
Better not: Do not ignore the message, because the affected module may crash or, as with OpenCV, may not load at all.
Set up from scratch again
If it still doesn’t work after that, a fresh setup step by step often helps:
- Set up and maintain ComfyUI on Windows
Desktop or Portable, where the models belong, sharing models with other programs, safely installing custom nodes, updates, startup options … - Your First Image with ComfyUI
Install Comfy Desktop, learn the interface, and create your first AI image with FLUX.2 [small] 4B or Z-Image Turbo. - Your First AI Video with LTX in ComfyUI
Use LTX-2.3 in ComfyUI to create short videos with sound from text or an image. Template, files, settings, and license.
Terms for this
Similar errors
- ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied – pip cannot modify a file
- ImportError: DLL load failed while importing …: The specified module could not be found – a Python package is missing a Windows DLL
- No matching distribution found for torch (wrong Python version)
- pip: Microsoft Visual C++ 14.0 or greater is required
- 'python' is not recognized or opens the Microsoft Store
Sources
- https://numpy.org/devdocs/dev/depending_on_numpy.html
- https://github.com/PythonOT/POT/issues/644
- https://github.com/opencv/opencv-python/issues/1149
Checked on Oct 27, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.