Free | No tracking | Every fact with a source|German and English

Error / Installation

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

  1. 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.
  2. 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.
  3. 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).
  4. 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".
  5. 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:

Terms for this

Similar errors

Sources

Checked on Oct 27, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.