Skip to content

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

Open

Description

@braindevices

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

Activity

  1. KumoLiu commented on Jan 3, 2025

    @KumoLiu
    Contributor

    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)

  2. matham commented on Mar 14, 2025

    @matham

    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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions