opencv-python icon indicating copy to clipboard operation
opencv-python copied to clipboard

Add NumPy upper-bound pin for Python 3.14 compatibility

Open FaryalRizwaan opened this issue 11 months ago • 6 comments

This PR adds a Python 3.14–specific NumPy version constraint in pyproject.toml to fix dependency resolution failures when installing opencv-python on Python 3.14.

Issue: #1165 – Installation fails on Python 3.14 because no compatible NumPy version is selected during build dependency resolution.

Changes

Added an environment marker in pyproject.toml to require numpy>=2.1.3,<2.2 for python_version >= '3.14'.

Preserves existing dependency behavior for Python 3.8–3.13.

No changes to setup.py; the fix is fully compliant with PEP 518 and modern packaging standards.

Testing

Verified dependency resolution using pip install --dry-run -e ..

Confirmed that the new marker does not affect installation on supported Python versions (3.8–3.13).

The pinned NumPy version (2.1.3) is published on PyPI and declares Python 3.14 support via classifiers.

This minimal, forward-compatible change ensures opencv-python remains installable as Python 3.14 adoption begins.

FaryalRizwaan avatar Dec 30 '25 12:12 FaryalRizwaan

This PR correctly adds a Python 3.14–specific NumPy constraint and resolves the missing dependency case described in #1165. The environment marker is forward-compatible and preserves existing behavior for Python 3.8–3.13. Looks good to me.

ayushrajput6128 avatar Jan 15 '26 10:01 ayushrajput6128

Thanks for the review, @ayushrajput6128 ! Glad to hear the environment markers look correct to you.

FaryalRizwaan avatar Jan 15 '26 10:01 FaryalRizwaan

Versions should not be overly constrained, please see #1140

mhicks-cfs avatar Jan 16 '26 21:01 mhicks-cfs

Release 4.13.0.90, which supports Python 3.14, is not yet in PyPI. Is there any scheduled date for releasing it under PyPI?

lucalista avatar Jan 17 '26 09:01 lucalista

And that approach was already taken in gh-1121 (still open), so I'd just close this PR.

rgommers avatar Feb 02 '26 14:02 rgommers

Yeah this should be closed in favor of https://github.com/opencv/opencv-python/pull/1121

Avasam avatar Jun 23 '26 14:06 Avasam