Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install MONAI with NumPy 2 #21

Open
function2-llx opened this issue Dec 27, 2024 · 1 comment
Open

Unable to install MONAI with NumPy 2 #21

function2-llx opened this issue Dec 27, 2024 · 1 comment

Comments

@function2-llx
Copy link

Currently, It is impossible to install both MONAI and NumPy 2 with conda due to the constraints in the recipe.

- numpy >=1.24, <2.0

I have found a suggestion from the MONAI repo. However, it only works for pip.

I think it would work for you to try installing MONAI in an environment (venv or conda) and then installing Numpy 2.0 subsequently.

@function2-llx
Copy link
Author

Would like to share additional comments here regarding the comment from the MONAI repo.

The problem that everyone has discovered is that their versions strings for Numpy would set a minimum requirement but not a max, so Numpy 2.0 with its incompatibility isn't excluded.

I guess this issue becomes much better when managing packages with conda (especially when using conda-forge) compared to pip.

The dependency issue for us is that we do want to continue supporting older versions of Pytorch because many users may need older versions for compatibility or because their environment requires it. The problem that everyone has discovered is that their versions strings for Numpy would set a minimum requirement but not a max, so Numpy 2.0 with its incompatibility isn't excluded. Older versions of libraries are unlikely to be updated with support for Numpy 2.0, and we have no way of forcing Numpy 1.x when these are present. For the moment we've chosen to just restrict the version although MONAI itself should be compatible now with the changes made.

I appreciate your efforts here. However, it sounds to me like an issue upstream from MONAI, is that correct? Given that MONAI itself, as well as the latest dependencies, is compatible with NumPy 2, I believe that MONAI could fulfill its obligations as long as it reminds users of something like the following in the documentation: If users would like to use certain old versions of dependencies, it may lead to incompatibility with NumPy 2, in which case they should consider downgrading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant