Skip to content

[Windows] MINGW-W64 experimental build warnings with NumPy 2.2.6 on Python 3.14.2 #1172

@moizza-nasir

Description

@moizza-nasir

Description

NumPy 2.2.6 installed via pip on Windows 64-bit shows MINGW-W64 experimental build warnings and runtime errors when used with OpenCV.

Environment

  • OS: Windows 64-bit
  • Python Version: 3.14.2
  • NumPy Version: 2.2.6
  • OpenCV Version: 4.12.0.88
  • Installation Method: pip install numpy opencv-python
  • Virtual Environment: Yes (venv)

Steps to Reproduce

  1. Create virtual environment: python -m venv .venv
  2. Activate: .venv\Scripts\Activate.ps1
  3. Install: pip install opencv-python (installs numpy 2.2.6 as dependency)
  4. Run simple OpenCV code:
import cv2 as cv
img = cv.imread("image.jpg")
cv.imshow('window', img)
cv.waitKey(0)
cv.destroyAllWindows()

Expected Behavior

NumPy and OpenCV should import and run without warnings.

Actual Behavior

Warning Message:

<frozen importlib._bootstrap>:491: Warning: Numpy built with MINGW-W64 on Windows 64 bits is experimental, and only available for testing. You are advised not to use it for production.
CRASHES ARE TO BE EXPECTED - PLEASE REPORT THEM TO NUMPY DEVELOPERS

Runtime Warnings:

C:\Python\.venv\Lib\site-packages\numpy\core\getlimits.py:225: RuntimeWarning: invalid value encountered in exp2
  epsneg_f128 = exp2(ld(-113))
C:\Python\.venv\Lib\site-packages\numpy\core\getlimits.py:226: RuntimeWarning: invalid value encountered in exp2
  tiny_f128 = exp2(ld(-16382))
C:\Python\.venv\Lib\site-packages\numpy\core\getlimits.py:240: RuntimeWarning: invalid value encountered in exp2
  eps=exp2(ld(-112)),
C:\Python\.venv\Lib\site-packages\numpy\core\getlimits.py:41: RuntimeWarning: invalid value encountered in nextafter
  self._smallest_subnormal = nextafter(
C:\Python\.venv\Lib\site-packages\numpy\core\getlimits.py:52: RuntimeWarning: invalid value encountered in log10
  self.precision = int(-log10(self.eps))

Additional Information

pip show numpy output:

Name: numpy
Version: 2.2.6
Location: c:\Python\.venv\Lib\site-packages
Requires:
Required-by: opencv-python

What I've Tried

  • Reinstalling with --only-binary :all: flag
  • Clearing pip cache: pip cache purge
  • Force reinstall: pip install --force-reinstall numpy
  • Downgrading to numpy 1.26.4 (causes dependency conflict with opencv 4.12)

Questions

  1. Why is NumPy 2.2.6 on PyPI built with MINGW-W64 for Windows?
  2. Is there an official Windows build available?
  3. Should I downgrade to Python 3.11/3.12 or wait for fixes?
  4. What's the recommended NumPy + OpenCV combination for Windows currently?

System Details

python --version
# Python 3.14.2

pip --version
# pip 25.3

pip list
# numpy         2.2.6
# opencv-python 4.12.0.88

Workaround Attempted

Tried using numpy==1.26.4 but got:

ERROR: opencv-python 4.12.0.88 requires numpy<2.3.0,>=2; python_version >= "3.9", 
but you have numpy 1.26.4 which is incompatible.

Any guidance would be appreciated!

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