You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
monai use very old numpy 1.46 can we bump up to 2.x? #8277
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
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: #7857 (comment)
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?
Reacted by Adam Tyson, Stepanenko Denis, Kostiantyn Lavronenko, arthurdjn and Trilok Khairnar
Activity
KumoLiu commentedon Jan 3, 2025
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: #7857 (comment)
matham commentedon Mar 14, 2025
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 justpip 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?