simpeg / discretize

Discretization tools for finite volume and inverse problems.
http://discretize.simpeg.xyz/
MIT License
166 stars 34 forks source link

discretize and numpy 2 problem #378

Open Patrick-Cole opened 6 days ago

Patrick-Cole commented 6 days ago

When I install discretize via pip, with numpy 2, I get the following error:

A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.2 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.

Traceback (most recent call last): File "", line 1, in File "C:\Python\WPy64-31260\python-3.12.6.amd64\Lib\site-packages\discretize__init.py", line 39, in from discretize.tensor_mesh import TensorMesh File "C:\Python\WPy64-31260\python-3.12.6.amd64\Lib\site-packages\discretize\tensor_mesh.py", line 5, in from discretize.base import BaseRectangularMesh, BaseTensorMesh File "C:\Python\WPy64-31260\python-3.12.6.amd64\Lib\site-packages\discretize\base__init__.py", line 19, in from discretize.base.base_mesh import BaseMesh File "C:\Python\WPy64-31260\python-3.12.6.amd64\Lib\site-packages\discretize\base\base_mesh.py", line 7, in from discretize.utils import is_scalar, mkvc, sdiag, sdinv File "C:\Python\WPy64-31260\python-3.12.6.amd64\Lib\site-packages\discretize\utils\init__.py", line 146, in from discretize.utils.interpolation_utils import interpolation_matrix, volume_average File "C:\Python\WPy64-31260\python-3.12.6.amd64\Lib\site-packages\discretize\utils\interpolation_utils.py", line 8, in from discretize._extensions import interputils_cython as pyx numpy.core.multiarray failed to import (auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; use 'numpy._import_array' to disable if you are certain you don't need it).

Patrick-Cole commented 6 days ago

The error comes after I try to import discretize