Skip to content

Incompatibility with Numpy 1.x #1211

@jgauth

Description

@jgauth

Starting with opencv-python-headless==4.12.0.88, pip reports incompatibility with numpy<2.

pip output
# pip install opencv-python-headless==4.12.0.88
Collecting opencv-python-headless==4.12.0.88
  Using cached opencv_python_headless-4.12.0.88-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (19 kB)
Collecting numpy<2.3.0,>=2 (from opencv-python-headless==4.12.0.88)
  Using cached numpy-2.2.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (62 kB)
Using cached opencv_python_headless-4.12.0.88-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (54.0 MB)
Using cached numpy-2.2.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.8 MB)
Installing collected packages: numpy, opencv-python-headless
  Attempting uninstall: numpy
    Found existing installation: numpy 1.26.4
    Uninstalling numpy-1.26.4:
      Successfully uninstalled numpy-1.26.4
  Attempting uninstall: opencv-python-headless
    Found existing installation: opencv-python-headless 4.13.0.92
    Uninstalling opencv-python-headless-4.13.0.92:
      Successfully uninstalled opencv-python-headless-4.13.0.92
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
atom 0.4.0 requires numpy==1.26.4, but you have numpy 2.2.6 which is incompatible.

This is an issue for me, because I'm stuck on numpy 1.x for other reasons. I think that the opencv numpy constraint could be relaxed, however. From the numpy docs:

When you build wheels for your package using a NumPy 2.x version at build time, those will work with NumPy 1.xx.
https://numpy.org/doc/2.0/dev/depending_on_numpy.html#numpy-2-0-specific-advice

Is there some other reason that I'm not aware for the incompatibility? Otherwise, I can open a PR for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions