InsightSoftwareConsortium / ITK

Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.
https://itk.org
Apache License 2.0
1.37k stars 660 forks source link

itk install error in macOS-latest #4614

Closed KumoLiu closed 2 months ago

KumoLiu commented 2 months ago

Looks itk>=5.2 can be installed successfully yesterday. https://github.com/Project-MONAI/MONAI/actions/runs/8831347714/job/24246389623#step:10:145 But not today:

ERROR: Ignored the following versions that require a different python version: 1.11.0 Requires-Python <3.13,>=3.9; 1.11.0rc1 Requires-Python <3.13,>=3.9; 1.11.0rc2 Requires-Python <3.13,>=3.9; 1.11.1 Requires-Python <3.13,>=3.9; 1.11.2 Requires-Python <3.13,>=3.9; 1.11.3 Requires-Python <3.13,>=3.9; 1.11.4 Requires-Python >=3.9; 1.12.0 Requires-Python >=3.9; 1.12.0rc1 Requires-Python >=3.9; 1.12.0rc2 Requires-Python >=3.9; 1.13.0 Requires-Python >=3.9; 1.13.0rc1 Requires-Python >=3.9
ERROR: Could not find a version that satisfies the requirement itk>=5.2 (from versions: 4.12.0.post1, 4.13.0, 4.13.1.post1, 5.0a1, 5.0a2, 5.0b1, 5.0b3, 5.0rc1, 5.0rc2, 5.0.0, 5.0.0.post1, 5.0.1)
ERROR: No matching distribution found for itk>=5.2

https://github.com/Project-MONAI/MONAI/actions/runs/8833587029/job/24282045229#step:10:144

Does it drop support for 3.8?

Thanks

github-actions[bot] commented 2 months ago

Thank you for contributing an issue! 🙏

Welcome to the ITK community! 🤗👋☀️

We are glad you are here and appreciate your contribution. Please keep in mind our community participation guidelines. 📜 Also, please check existing open issues and consider discussion on the ITK Discourse. 📖

This is an automatic message. Allow for time for the ITK community to be able to read the issue and comment on it.

dzenanz commented 2 months ago

Even the latest release (5.4RC4) has Python 3.8 wheels. It must be something else.

KumoLiu commented 2 months ago

Hi @dzenanz, thanks for the quick response. Then it's wired, I try to install it in a fresh conda python=3.8 env, it also throw errors.

(base) bash-3.2$ conda activate py3.8
(py3.8) bash-3.2$ pip install itk>=5.2
  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

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
dzenanz commented 2 months ago

Ah, so you are not installing from wheels but instead building from source. ITK recently switched from setup.py to scikit-build. Which means there is another requirement now, which you probably need to add to some list of requirements.

KumoLiu commented 2 months ago

So do you mean pip install itk==5.3.0 will try to build from source when python 3.8 but download wheel when python 3.9? https://github.com/Project-MONAI/MONAI/actions/runs/8849038116/job/24300068122?pr=7719#step:10:146

dzenanz commented 2 months ago

Uh-oh, @thewtex and/or @jcfr should be able to answer that, or provide more meaningful help for this issue.

dzenanz commented 2 months ago

There are wheels for both ARM and AMD64 for MacOSX for ITK 5.3, for Python 3.9+. Python 3.8 and 3.7 have only AMD64 wheels. Are you trying to pip install itk==5.3.0 for some configuration which doesn't have pre-built wheels?

dzenanz commented 2 months ago

Should this issue be closed now, in light of https://github.com/Project-MONAI/MONAI/issues/7716? Have you figured out the root cause? We have not touched ITK 5.2 in quite a while.

KumoLiu commented 2 months ago

Hi @dzenanz, I still didn't find the root cause. We decided to partially drop support for 3.8 as it's reaching end-of-life soon anyhow. Closing this one now. Thanks.

thewtex commented 2 months ago

@KumoLiu I noticed in the linked MONAI CI Action log:

image

-- in CI, a good best practice is to upgrade pip with python -m install --upgrade pip so it can find the latest packages, regardless of project. HTH