Skip to content

Do not test NumPy against Python 3.15 Windows AMD64 wheels#9674

Merged
mergify[bot] merged 1 commit into
python-pillow:mainfrom
radarhere:numpy_windows
Jun 15, 2026
Merged

Do not test NumPy against Python 3.15 Windows AMD64 wheels#9674
mergify[bot] merged 1 commit into
python-pillow:mainfrom
radarhere:numpy_windows

Conversation

@radarhere

Copy link
Copy Markdown
Member

Our Windows AMD64 wheel job has started failing to use NumPy with Python 3.15 - https://github.com/python-pillow/Pillow/actions/runs/27486116482/job/81311124359#step:7:37627

  ImportError while importing test module 'C:\pillow\Tests\test_image_array.py'.
  Hint: make sure your test modules/packages have valid Python names.
  Traceback:
  C:\Users\runneradmin\AppData\Local\Temp\cibw-run-bfoqmbqc\cp315-win_amd64\venv-test\Lib\site-packages\numpy\_core\__init__.py:24: in <module>
      from . import multiarray
  C:\Users\runneradmin\AppData\Local\Temp\cibw-run-bfoqmbqc\cp315-win_amd64\venv-test\Lib\site-packages\numpy\_core\multiarray.py:11: in <module>
      from . import _multiarray_umath, overrides
  E   ImportError: DLL load failed while importing _multiarray_umath: The specified module could not be found.

Since NumPy hasn't added support for Python 3.15 yet, this PR simply stops testing our Python 3.15 wheels with NumPy.

@hugovk

hugovk commented Jun 15, 2026

Copy link
Copy Markdown
Member

The root cause of this is a change in pytest 9.1 which just came out.

And of course NumPy doesn't support 3.15 yet. We build it from source, then have this in test_image_array.py:

numpy = pytest.importorskip("numpy", reason="NumPy not installed")

With pytest 9.0, we try and import it, it fails due to _multiarray_umath.pyd, we get an ImportError, then pytest skips.

pytest 9.0 also had a deprecation warning we didn't spot, saying they were going to change the default from skipping for ImportError to skipping for ModuleNotFoundError (a subclass of ImportError).

And this default changed to ModuleNotFoundError in pytest 9.1, so our ImportError is no longer skipped.

Details at:

https://docs.pytest.org/en/stable/deprecations.html#pytest-importorskip-default-behavior-regarding-importerror

We could tell importorskip to continue catching ImportError? So when NumPy starts working, we don't need to remember to remove this exclusion.

Or we could narrow the select to only exclude the failing Windows AMD64? So all the others (at least Linux, macOS) continue to test NumPy. We'll need to remember to remove it later.


With 9.0:

============================== warnings summary ===============================
  Tests\test_image_array.py:12
    C:\pillow\Tests\test_image_array.py:12: PytestDeprecationWarning: 
    Module 'numpy' was found, but when imported by pytest it raised:
        ImportError('\n\nIMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!\n\nImporting the numpy C-extensions failed. This error can happen for\nmany reasons, often due to issues with your setup or how NumPy was\ninstalled.\n\nWe have compiled some common reasons and troubleshooting tips at:\n\n    [https://numpy.org/devdocs/user/troubleshooting-importerror.html\n\nPlease](https://numpy.org/devdocs/user/troubleshooting-importerror.html/n/nPlease) note and check the following:\n\n  * The Python version is: Python 3.15 from "C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-ktbsigsw\\cp315-win_amd64\\venv-test\\Scripts\\python.exe"\n  * The NumPy version is: "2.4.6"\n\nand make sure that they are the versions you expect.\n\nPlease carefully study the information and documentation linked above.\nThis is unlikely to be a NumPy issue but will be caused by a bad install\nor environment on your machine.\n\nOriginal error was: DLL load failed while importing _multiarray_umath: The specified module could not be found.\n')
    In pytest 9.1 this warning will become an error by default.
    You can fix the underlying problem, or alternatively overwrite this behavior and silence this warning by passing exc_type=ImportError explicitly.
    See https://docs.pytest.org/en/stable/deprecations.html#pytest-importorskip-default-behavior-regarding-importerror
      numpy = pytest.importorskip("numpy", reason="NumPy not installed")
  
  Tests\test_numpy.py:16
    C:\pillow\Tests\test_numpy.py:16: PytestDeprecationWarning: 
    Module 'numpy' was found, but when imported by pytest it raised:
        ImportError('\n\nIMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!\n\nImporting the numpy C-extensions failed. This error can happen for\nmany reasons, often due to issues with your setup or how NumPy was\ninstalled.\n\nWe have compiled some common reasons and troubleshooting tips at:\n\n    [https://numpy.org/devdocs/user/troubleshooting-importerror.html\n\nPlease](https://numpy.org/devdocs/user/troubleshooting-importerror.html/n/nPlease) note and check the following:\n\n  * The Python version is: Python 3.15 from "C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-ktbsigsw\\cp315-win_amd64\\venv-test\\Scripts\\python.exe"\n  * The NumPy version is: "2.4.6"\n\nand make sure that they are the versions you expect.\n\nPlease carefully study the information and documentation linked above.\nThis is unlikely to be a NumPy issue but will be caused by a bad install\nor environment on your machine.\n\nOriginal error was: DLL load failed while importing _multiarray_umath: The specified module could not be found.\n')
    In pytest 9.1 this warning will become an error by default.
    You can fix the underlying problem, or alternatively overwrite this behavior and silence this warning by passing exc_type=ImportError explicitly.
    See https://docs.pytest.org/en/stable/deprecations.html#pytest-importorskip-default-behavior-regarding-importerror
      numpy = pytest.importorskip("numpy", reason="NumPy not installed")
  
  Tests/test_map.py::test_ysize
    C:\pillow\Tests\test_map.py:37: PytestDeprecationWarning: 
    Module 'numpy' was found, but when imported by pytest it raised:
        ImportError('\n\nIMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!\n\nImporting the numpy C-extensions failed. This error can happen for\nmany reasons, often due to issues with your setup or how NumPy was\ninstalled.\n\nWe have compiled some common reasons and troubleshooting tips at:\n\n    [https://numpy.org/devdocs/user/troubleshooting-importerror.html\n\nPlease](https://numpy.org/devdocs/user/troubleshooting-importerror.html/n/nPlease) note and check the following:\n\n  * The Python version is: Python 3.15 from "C:\\Users\\runneradmin\\AppData\\Local\\Temp\\cibw-run-ktbsigsw\\cp315-win_amd64\\venv-test\\Scripts\\python.exe"\n  * The NumPy version is: "2.4.6"\n\nand make sure that they are the versions you expect.\n\nPlease carefully study the information and documentation linked above.\nThis is unlikely to be a NumPy issue but will be caused by a bad install\nor environment on your machine.\n\nOriginal error was: DLL load failed while importing _multiarray_umath: The specified module could not be found.\n')
    In pytest 9.1 this warning will become an error by default.
    You can fix the underlying problem, or alternatively overwrite this behavior and silence this warning by passing exc_type=ImportError explicitly.
    See https://docs.pytest.org/en/stable/deprecations.html#pytest-importorskip-default-behavior-regarding-importerror
      numpy = pytest.importorskip("numpy", reason="NumPy not installed")
  
  -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
  =========================== short test summary info ===========================
  SKIPPED [1] Tests\oss-fuzz\test_fuzzers.py:14: Fuzzer doesn't run on Windows or iOS
  SKIPPED [1] Tests\test_arro3.py:27: Arro3 not installed
  SKIPPED [1] Tests\test_image_array.py:12: NumPy not installed

https://github.com/python-pillow/Pillow/actions/runs/27249335954/job/80480198415#step:7:41704

With 9.1:

  =================================== ERRORS ====================================
  _________________ ERROR collecting Tests/test_image_array.py __________________
  ImportError while importing test module 'C:\pillow\Tests\test_image_array.py'.
  Hint: make sure your test modules/packages have valid Python names.
  Traceback:
  C:\Users\runneradmin\AppData\Local\Temp\cibw-run-bfoqmbqc\cp315-win_amd64\venv-test\Lib\site-packages\numpy\_core\__init__.py:24: in <module>
      from . import multiarray
  C:\Users\runneradmin\AppData\Local\Temp\cibw-run-bfoqmbqc\cp315-win_amd64\venv-test\Lib\site-packages\numpy\_core\multiarray.py:11: in <module>
      from . import _multiarray_umath, overrides
  E   ImportError: DLL load failed while importing _multiarray_umath: The specified module could not be found.
  
  The above exception was the direct cause of the following exception:
  C:\Users\runneradmin\AppData\Local\Temp\cibw-run-bfoqmbqc\cp315-win_amd64\venv-test\Lib\site-packages\_pytest\python.py:508: in importtestmodule
      mod = import_path(
  C:\Users\runneradmin\AppData\Local\Temp\cibw-run-bfoqmbqc\cp315-win_amd64\venv-test\Lib\site-packages\_pytest\pathlib.py:596: in import_path
      importlib.import_module(module_name)
  C:\cibw\nuget-cpython\python.3.15.0-b2\tools\Lib\importlib\__init__.py:88: in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  <frozen importlib._bootstrap>:1381: in _gcd_import
      ???
  <frozen importlib._bootstrap>:1346: in _find_and_load
      ???
  <frozen importlib._bootstrap>:1305: in _find_and_load_unlocked
      ???
  <frozen importlib._bootstrap>:915: in _load_unlocked
      ???
  C:\Users\runneradmin\AppData\Local\Temp\cibw-run-bfoqmbqc\cp315-win_amd64\venv-test\Lib\site-packages\_pytest\assertion\rewrite.py:188: in exec_module
      exec(co, module.__dict__)
  Tests\test_image_array.py:12: in <module>
      numpy = pytest.importorskip("numpy", reason="NumPy not installed")
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  C:\cibw\nuget-cpython\python.3.15.0-b2\tools\Lib\importlib\__init__.py:88: in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  <frozen importlib._bootstrap>:1381: in _gcd_import
      ???
  <frozen importlib._bootstrap>:1346: in _find_and_load
      ???
  <frozen importlib._bootstrap>:1305: in _find_and_load_unlocked
      ???
  <frozen importlib._bootstrap>:915: in _load_unlocked
      ???
  <frozen importlib._bootstrap_external>:747: in exec_module
      ???
  <frozen importlib._bootstrap>:549: in _call_with_frames_removed
      ???
  C:\Users\runneradmin\AppData\Local\Temp\cibw-run-bfoqmbqc\cp315-win_amd64\venv-test\Lib\site-packages\numpy\__init__.py:112: in <module>
      from numpy.__config__ import show_config
  C:\Users\runneradmin\AppData\Local\Temp\cibw-run-bfoqmbqc\cp315-win_amd64\venv-test\Lib\site-packages\numpy\__config__.py:4: in <module>
      from numpy._core._multiarray_umath import (
  C:\Users\runneradmin\AppData\Local\Temp\cibw-run-bfoqmbqc\cp315-win_amd64\venv-test\Lib\site-packages\numpy\_core\__init__.py:85: in <module>
      raise ImportError(msg) from exc
  E   ImportError: 
  E   
  E   IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
  E   
  E   Importing the numpy C-extensions failed. This error can happen for
  E   many reasons, often due to issues with your setup or how NumPy was
  E   installed.
  E   
  E   We have compiled some common reasons and troubleshooting tips at:
  E   
  E       https://numpy.org/devdocs/user/troubleshooting-importerror.html
  E   
  E   Please note and check the following:
  E   
  E     * The Python version is: Python 3.15 from "C:\Users\runneradmin\AppData\Local\Temp\cibw-run-bfoqmbqc\cp315-win_amd64\venv-test\Scripts\python.exe"
  E     * The NumPy version is: "2.4.6"
  E   
  E   and make sure that they are the versions you expect.
  E   
  E   Please carefully study the information and documentation linked above.
  E   This is unlikely to be a NumPy issue but will be caused by a bad install
  E   or environment on your machine.
  E   
  E   Original error was: DLL load failed while importing _multiarray_umath: The specified module could not be found.
  =========================== short test summary info ===========================
  SKIPPED [1] Tests\oss-fuzz\test_fuzzers.py:14: Fuzzer doesn't run on Windows or iOS
  SKIPPED [1] Tests\test_arro3.py:27: Arro3 not installed
  ERROR Tests/test_image_array.py
  !!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!
  ========================= 2 skipped, 1 error in 4.19s =========================

https://github.com/python-pillow/Pillow/actions/runs/27486116482/job/81311124359#step:7:37626

@radarhere

Copy link
Copy Markdown
Member Author

Or we could narrow the select to only exclude the failing Windows AMD64? So all the others (at least Linux, macOS) continue to test NumPy. We'll need to remember to remove it later.

This would be my preference. I would rather have explicit reminder in the repository, instead of silently skipping and potentially forgetting about it.

@radarhere radarhere changed the title Do not test NumPy against Python 3.15 wheels Do not test NumPy against Python 3.15 Windows AMD64 wheels Jun 15, 2026

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@hugovk hugovk added the automerge Automatically merge PRs that are ready label Jun 15, 2026
@mergify mergify Bot merged commit a4cbe9d into python-pillow:main Jun 15, 2026
67 of 68 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Automatically merge PRs that are ready NumPy Testing Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants