the-virtual-brain / tvb-gdist

Geodesic Library (adaptation by TVB Team)
Other
48 stars 30 forks source link

[BUG] Failure to import with numpy 2.0 #82

Open pbarbarant opened 4 months ago

pbarbarant commented 4 months ago

Hi ! I noticed that importing gdist with Numpy 2.0 installed results in the following failure:

python3 -c "import gdist"

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 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 "<string>", line 1, in <module>
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "gdist.pyx", line 1, in init gdist
ImportError: numpy.core.multiarray failed to import (auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; use '<void>numpy._import_array' to disable if you are certain you don't need it).

As for now it seems that all projects relying on tvb-gdist will need to downgrade to numpy<2.