ExactPack icon indicating copy to clipboard operation
ExactPack copied to clipboard

ExactPack incompatible with numpy >= 2

Open tjfulle opened this issue 4 months ago • 1 comments

ExactPack's requirements.txt gives the numpy requirement as numpy >= 1.13.3, but I get the following error when trying to run its tests:

$ pytest $(python3 -c 'import importlib.resources; print(import lib.resources.files("exactpack")')
...
______________ ERROR collecting venv/lib/python3.11/site-packages/exactpack/tests/test_riemann.py _______________
ImportError while importing test module '.../venv/lib/python3.11/site-packages/exactpack/tests/test_riemann.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/python/3.11/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
../venv/lib/python3.11/site-packages/exactpack/tests/test_riemann.py:11: in <module>
    from exactpack.solvers.riemann.ep_riemann import IGEOS_Solver, GenEOS_Solver, streakplot
../venv/lib/python3.11/site-packages/exactpack/solvers/riemann/__init__.py:256: in <module>
    from .ep_riemann import *
../venv/lib/python3.11/site-packages/exactpack/solvers/riemann/ep_riemann.py:8: in <module>
    import matplotlib.pyplot as plt
/opt/python/3.11/lib/python3.11/site-packages/matplotlib/__init__.py:161: in <module>
    from . import _api, _version, cbook, _docstring, rcsetup
/opt/python/3.11/lib/python3.11/site-packages/matplotlib/rcsetup.py:27: in <module>
    from matplotlib.colors import Colormap, is_color_like
/opt/python/3.11/lib/python3.11/site-packages/matplotlib/colors.py:57: in <module>
    from matplotlib import _api, _cm, cbook, scale
/opt/python/3.11/lib/python3.11/site-packages/matplotlib/scale.py:22: in <module>
    from matplotlib.ticker import (
/opt/python/3.11/lib/python3.11/site-packages/matplotlib/ticker.py:143: in <module>
    from matplotlib import transforms as mtransforms
/opt/python/3.11/lib/python3.11/site-packages/matplotlib/transforms.py:49: in <module>
    from matplotlib._path import (
E   ImportError: numpy.core.multiarray failed to import
------------------------------------------------ Captured stderr ------------------------------------------------

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.3.3 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

When I forced installation of numpy < 2, the tests ran as expected.

tjfulle avatar Sep 24 '25 02:09 tjfulle

Hi @tjfulle , I just pushed the latest version which does contain fixes for numpy 2. I have tested it with numpy 2.2.4 on Python 3.11.5 and Python 3.12.7. Let me know if you have any further issues.

jthrussell avatar Sep 24 '25 22:09 jthrussell