dynamics-of-stellar-systems / dynamite

dynamics, age and metallicity indicators tracing evolution
MIT License
14 stars 1 forks source link

ImportError: Numba needs NumPy 1.24 or less after installation in Py3.10 #314

Closed sthater closed 1 year ago

sthater commented 1 year ago

import dynamite Traceback (most recent call last): File "", line 1, in File "/home/fs71474/sthater/.local/lib/python3.10/site-packages/dynamite-3.0.0-py3.10.egg/dynamite/init.py", line 1, in from dynamite import analysis, constants, data, mges, orblib, physical_system, populations, weight_solvers, parameter_space, model, config_reader, model_iterator, kinematics, plotter, myrand File "/home/fs71474/sthater/.local/lib/python3.10/site-packages/dynamite-3.0.0-py3.10.egg/dynamite/orblib.py", line 10, in import sparse File "/home/fs71474/sthater/.local/lib/python3.10/site-packages/sparse-0.14.0-py3.10.egg/sparse/init.py", line 1, in from ._coo import COO, as_coo File "/home/fs71474/sthater/.local/lib/python3.10/site-packages/sparse-0.14.0-py3.10.egg/sparse/_coo/init.py", line 1, in from .core import COO, as_coo File "/home/fs71474/sthater/.local/lib/python3.10/site-packages/sparse-0.14.0-py3.10.egg/sparse/_coo/core.py", line 9, in import numba File "/home/fs71474/sthater/.local/lib/python3.10/site-packages/numba-0.57.1-py3.10-linux-x86_64.egg/numba/init.py", line 55, in _ensure_critical_deps() File "/home/fs71474/sthater/.local/lib/python3.10/site-packages/numba-0.57.1-py3.10-linux-x86_64.egg/numba/init.py", line 42, in _ensure_critical_deps raise ImportError("Numba needs NumPy 1.24 or less") ImportError: Numba needs NumPy 1.24 or less

maindlt commented 1 year ago

Hi Sabine, this is an issue with numba not supporting the latest numpy version and for some reasons the dependency resolution gets confused. The same issue occurred for Malika and myself, too. What worked for me is deleting the local installation folder (rm -rf ~/.local/lib/python3.10/site-packages) and reinstalling DYNAMITE (python setup.py install --user). Does this work for you? Alternatively, we can also update the numpy dependency in requirements.txt (numpy>=1.20.1 -> numpy<=1.24,>=1.20.1) which we can lift as soon as numba supports a newer numpy version, but I tend to refrain from imposing an upper limit, especially on numpy as a key package...

maindlt commented 1 year ago

Hi Sabine, I updated the numpy requirements after all, see PR #317. Does this solve the issue?