MONAI icon indicating copy to clipboard operation
MONAI copied to clipboard

monai use very old numpy 1.46 can we bump up to 2.x?

Open braindevices opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. monai 1.4.0 requires numpy<2.0,>=1.24, but you have numpy 2.2.1 which is incompatible. lots of other packages already require numpy 2.x

Describe the solution you'd like build with numpy 2.x api

braindevices avatar Jan 02 '25 19:01 braindevices

Hi @braindevices, thanks for reporting.

The easy way for now is try installing MONAI in an environment (venv or conda) and then installing Numpy 2.0 subsequently. For more details, refer to: https://github.com/Project-MONAI/MONAI/pull/7857#issuecomment-2489216291

KumoLiu avatar Jan 03 '25 03:01 KumoLiu

From that comment, it seems that monai is compatible with latest numpy it's just that some of its dependencies are not. Presumably those dependencies list in their requirements the max level of numpy they support and pip will respect it. So why does monai also have to restrict it?

The main issue is that when monai is a dependency of a given package, mypackage, pip forces installation of a an older version of numpy, which causes issues. Typical instructions to install a package is just pip install mypackage. A second stage to install numpy complicates this. Especially if your project only has monai as a dependency of a dependecy. And pip will also print a warning about dependencies.

Is it possible to remove the restriction to < v2.0?

matham avatar Mar 14 '25 16:03 matham