Skip to content

fix: add explicit NumPy version constraints for Python 3.13+ and 3.14 (NumPy 2.x compatibility)#1223

Open
molhamfetnah wants to merge 1 commit intoopencv:4.xfrom
molhamfetnah:4.x
Open

fix: add explicit NumPy version constraints for Python 3.13+ and 3.14 (NumPy 2.x compatibility)#1223
molhamfetnah wants to merge 1 commit intoopencv:4.xfrom
molhamfetnah:4.x

Conversation

@molhamfetnah
Copy link
Copy Markdown

@molhamfetnah molhamfetnah commented May 9, 2026

Summary

  • Fix NumPy 2.x ABI compatibility issue for Python 3.13+ and 3.14
  • Changed to specify explicit minimum NumPy versions per Python version
  • This resolves the runtime error where wheels compiled against NumPy 1.x fail when used with NumPy 2.x

Changes

  • Python 3.9-3.12:
  • Python 3.13:
  • Python 3.14+:

Root Cause

The wheel metadata declared as dependency at install time, but the compiled wheels may have been built against NumPy 1.x headers, causing ABI incompatibility at runtime.

Fixes #1201

- Changed install_requires to specify minimum numpy versions per Python version:
  - Python 3.9-3.12: numpy>=2.0.2
  - Python 3.13: numpy>=2.1.3
  - Python 3.14+: numpy>=2.3.0
- This fixes NumPy 2.x ABI compatibility issue where wheels
  compiled against NumPy 1.x fail at runtime with NumPy 2.x

Fixes opencv#1201
Copilot AI review requested due to automatic review settings May 9, 2026 17:48
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Poor compatibility with Python 3.14+NumPy 2.3.3

2 participants