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

Outdated ITK requirement causes macOS pip installation of [all] to fail #8370

Open
Markus92 opened this issue Feb 27, 2025 · 1 comment
Open

Comments

@Markus92
Copy link

Describe the bug
The monai ITK requirement seems to be pegged to versions >=5.0, <=5.1.2; Unfortunately these cannot be installed in an environment of Python 3.11 on macOS w/ ARM. These versions are quite old (more than four years) and are pretty much from the pandemic era.

I am aware that setup.py references ITK > 5.2.0 but clearly this gets overriden somewhere.

To Reproduce
Steps to reproduce the behavior:

  1. Have a mac with m1 or later processor (2020 or later)
  2. Create new environment with Python 3.11
  3. Try installing pip install monai[all]
  4. Observe following output:
Collecting monai[all]
  Using cached monai-0.6.0-202107081903-py3-none-any.whl.metadata (6.0 kB)
Collecting itk<=5.1.2,>=5.0 (from monai[all])
  Using cached itk-5.0.1.tar.gz (13 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [4 lines of output]
      scikit-build is required to build from source.
      Please run:

        python -m pip install scikit-build
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed.

Manually installing ITK with pip install itk pulls version 5.4.2 and completes succesfully. With an nice arm64 build as well.

Expected behavior
Installation to happen succesfully.

Screenshots
See shell output above.

Environment

Ensuring you use the relevant python executable, please paste the output of:

python -c "import monai; monai.config.print_debug_info()"

This is after installing some requirements by hand:

(monai) ➜  ~ python -c "import monai; monai.config.print_debug_info()"

================================
Printing MONAI config...
================================
MONAI version: 1.4.0
Numpy version: 1.26.4
Pytorch version: 2.6.0
MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False
MONAI rev id: 46a5272196a6c2590ca2589029eed8e4d56ff008
MONAI __file__: /opt/homebrew/Caskroom/miniconda/base/envs/monai/lib/python3.11/site-packages/monai/__init__.py

Optional dependencies:
Pytorch Ignite version: NOT INSTALLED or UNKNOWN VERSION.
ITK version: 5.4.2
Nibabel version: 5.3.2
scikit-image version: 0.25.2
scipy version: 1.15.2
Pillow version: 11.1.0
Tensorboard version: NOT INSTALLED or UNKNOWN VERSION.
gdown version: NOT INSTALLED or UNKNOWN VERSION.
TorchVision version: NOT INSTALLED or UNKNOWN VERSION.
tqdm version: NOT INSTALLED or UNKNOWN VERSION.
lmdb version: NOT INSTALLED or UNKNOWN VERSION.
psutil version: NOT INSTALLED or UNKNOWN VERSION.
pandas version: NOT INSTALLED or UNKNOWN VERSION.
einops version: NOT INSTALLED or UNKNOWN VERSION.
transformers version: NOT INSTALLED or UNKNOWN VERSION.
mlflow version: NOT INSTALLED or UNKNOWN VERSION.
pynrrd version: NOT INSTALLED or UNKNOWN VERSION.
clearml version: NOT INSTALLED or UNKNOWN VERSION.

For details about installing the optional dependencies, please visit:
    https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies


================================
Printing system config...
================================
`psutil` required for `print_system_info`

================================
Printing GPU config...
================================
Num GPUs: 0
Has CUDA: False
cuDNN enabled: False
NVIDIA_TF32_OVERRIDE: None
TORCH_ALLOW_TF32_CUBLAS_OVERRIDE: None

Additional context
See also issue #1629 that was filed four years ago.

@jamesobutler
Copy link
Contributor

jamesobutler commented Feb 28, 2025

@Markus92 pip system cache is used whether using a virtualenv or not. It appears you have an old MONAI 0.6.0 whl in your cache so specifying pip install monai[all] is going to re-use that cached whl because you are not specifying a newer version of MONAI. If you did pip install monai[all] -U to upgrade the package as well, it would determine that you don’t have latest monai 1.4.0 and would download that whl from the web. The newer monai version specifies itk>=5.2 so it would pull the newer itk with the arm build.

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

2 participants