Skip to content

Numpy version fix #1122

Description

@Houbein

In the latest 4.12.0.88 release of opencv-python the Numpy version requirement was changed from a minimum version fix to a maximum version fix.
But the maximum version fix is set to an older version of Numpy, which caused Numpy to be downgraded on all our machines.
Please DO NOT DO THIS! I absolute hate maximum version locks when they are not absolutly necessary.
We have been running opencv-python with Numpy 2.3.1 without any issues, there is no need to forcibly downgrade everyone to Numpy 2.2.6.

Activity

  1. TheExDeus commented on Jul 8, 2025

    @TheExDeus

    Yeah, same. I hope this was just an oversight.

  2. yangw8 commented on Jul 10, 2025

    @yangw8

    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.
    opencv-python 4.12.0.88 requires numpy<2.3.0,>=2; python_version >= "3.9", but you have numpy 1.26.0 which is incompatible.
    opencv-python-headless 4.12.0.88 requires numpy<2.3.0,>=2; python_version >= "3.9", but you have numpy 1.26.0 which is incompatible.这个怎么解决啊

  3. schm0 commented on Jul 13, 2025

    @schm0

    Requiring Numpy 2.x for Python 3.9 makes it incompatible with older Tensorflow versions....
    tensorflow-intel 2.17.1 depends on numpy<2.0.0 and >=1.23.5; python_version <= "3.11"

  4. Tenzer commented on Jul 14, 2025

    @Tenzer

    #1121 should fix this.

  5. Houbein commented on Dec 8, 2025

    @Houbein
    Author

    So we are now 5 months on. The release candidate for numpy 2.4 has just come out, while this ticket for supporting numpy 2.3 is stil open.
    I have tested with numpy 2.4 just like I did with 2.3 and found 0 issues.
    Again, please either speed up your release cycle or relax version fixing, preferably both, it's really getting annoying now.

  6. asemoon commented on Dec 18, 2025

    @asemoon

    Hi Everyone,
    Has this been addressed? the numpy is stuck in a version where it is required to be updated by other packages now we are stuck.

  7. Houbein commented on Dec 18, 2025

    @Houbein
    Author

    There are now several tickets complaining about this.
    Again, there is ZERO code change needed to support even numpy 2.4, it just works, the problem is not the code, just your much too strict version fixing.

  8. guillaume-mueller commented on Jan 14, 2026

    @guillaume-mueller

    I can install numpy==2.4.1 with opencv-python-headless==4.11.0.86 but I can only install numpy>=2,<2.3.0 with opencv-python-headless==4.12.0.88, what the hell?

  9. Tenzer commented on Jan 14, 2026

    @Tenzer

    Looking at this again, I wonder if this actually already is fixed by #1142 which already has been merged, and just needs to be released?

    I'm not totally sure when the version restrictions in setup.py and pyproject.toml apply. I guess one might be for when building the wheel and one when installing the wheel?

    "numpy<2.0; python_version<'3.9'",
    "numpy==2.0.2; python_version>='3.9' and python_version<'3.13'",
    "numpy==2.1.3; python_version=='3.13'",

    opencv-python/setup.py

    Lines 26 to 27 in bfb85dc

    'numpy<2.0; python_version<"3.9"',
    'numpy>=2; python_version>="3.9"',

  10. Tenzer commented on Jan 19, 2026

    @Tenzer

    Version 4.13.0.90 was released yesterday which now depend on numpy >= 2.

  11. schm0 commented on Jan 19, 2026

    @schm0

    just edit the METDATA file and remove the numpy requirements.
    It even seems to work with Numpy versions 1.x.
    I did run 4.12 with python 3.11 and numpy 1.26.4 for quite some time.

  12. Houbein commented on Feb 2, 2026

    @Houbein
    Author

    Fixed by #1142

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions