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

Python requirements need to be updated for latest Slicer python version #55

Closed
jamesobutler opened this issue Mar 10, 2022 · 1 comment

Comments

@jamesobutler
Copy link
Contributor

Similar to what is needed at DCBIA-OrthoLab/MFSDA_Python#26

Slicer recently upgraded from Python 3.6.7 to Python 3.9.10 in Slicer/Slicer@34e48e8. There are now observed build errors of the ShapeVariationAnalyzer Slicer extension as seen at https://slicer.cdash.org/viewBuildError.php?buildid=2618477. This is because the python requirements file in the repo is including hashes that are only for Python 3.6 wheels. These need to be updated for Python 3.9 wheels which also means the actual version of packages here will need to be updated as some older versions simply don't have Python 3.9 wheels because that version was released before Python 3.9 was even released. For example scikit-learn==0.23.1 does not have Python 3.9 wheels available from PyPI (see here).

set(requirements_file ${CMAKE_BINARY_DIR}/${proj}-requirements.txt)
file(WRITE ${requirements_file} [===[
joblib==0.16.0 --hash=sha256:d348c5d4ae31496b2aa060d6d9b787864dd204f9480baaa52d18850cb43e9f49
threadpoolctl==2.1.0 --hash=sha256:38b74ca20ff3bb42caca8b00055111d74159ee95c4370882bbff2b93d24da725
# Hashes correspond to the following packages:
# - scikit_learn-0.23.1-cp36-cp36m-win_amd64.whl
# - scikit_learn-0.23.1-cp36-cp36m-macosx_10_9_x86_64.whl
# - scikit_learn-0.23.1-cp36-cp36m-manylinux1_x86_64.whl
scikit-learn==0.23.1 --hash=sha256:e585682e37f2faa81ad6cd4472fff646bf2fd0542147bec93697a905db8e6bd2 \
--hash=sha256:058d213092de4384710137af1300ed0ff030b8c40459a6c6f73c31ccd274cc39 \
--hash=sha256:e9879ba9e64ec3add41bf201e06034162f853652ef4849b361d73b0deb3153ad
]===])

jamesfishbaugh added a commit to slicersalt/ShapeVariationAnalyzer that referenced this issue Apr 4, 2022
…hon 3.9

This commit fixes the following error:

  Command failed: 1

   '/Volumes/D/P/S-0-build/python-install/bin/PythonSlicer' '-m' 'pip' 'install' '--require-hashes' '-r' '/.../ShapeVariationAnalyzer-build/python-ShapeVariationAnalyzer-requirements-requirements.txt' '--prefix' '/.../ShapeVariationAnalyzer-build/python-packages-install'

  See also

    /.../ShapeVariationAnalyzer-build/python-ShapeVariationAnalyzer-requirements-prefix/src/python-ShapeVariationAnalyzer-requirements-stamp/python-ShapeVariationAnalyzer-requirements-install-*.log

This addresses the issue initiated here: DCBIA-OrthoLab#55
jcfr added a commit to jcfr/ShapeVariationAnalyzer that referenced this issue Apr 6, 2022
…d of 3.6

This commit fixes the following build error:

```
  Command failed: 1

   '/Volumes/D/P/S-0-build/python-install/bin/PythonSlicer' '-m' 'pip' 'install' '--require-hashes' '-r' '/.../ShapeVariationAnalyzer-build/python-ShapeVariationAnalyzer-requirements-requirements.txt' '--prefix' '/.../ShapeVariationAnalyzer-build/python-packages-install'

  See also

    /.../ShapeVariationAnalyzer-build/python-ShapeVariationAnalyzer-requirements-prefix/src/python-ShapeVariationAnalyzer-requirements-stamp/python-ShapeVariationAnalyzer-requirements-install-*.log
```

The updates was performed following these steps using the updated
"python_package_updater.py" script assocated with PR Slicer/Slicer#6300:

```
# Set common variables
SLICER_SOURCE_DIR=~/Projects/Slicer
SLICER_DIR=~/Projects/Slicer-Release/Slicer-build
PYTHONSLICER_EXECUTABLE=${SLICER_DIR}/../python-install/bin/PythonSlicer

EXTENSION_SOURCE_DIR=/home/jcfr/Projects/ShapeVariationAnalyzer
EXTENSION_BINARY_DIR=/home/jcfr/Projects/ShapeVariationAnalyzer-Release

# Install packages into the prefix
PYTHON_INSTALL_PREFIX=${EXTENSION_BINARY_DIR}/python-packages-install
${PYTHONSLICER_EXECUTABLE} -m pip install --prefix ${PYTHON_INSTALL_PREFIX} scikit_learn

# Update extension external projects
UPDATER_SCRIPT=${SLICER_SOURCE_DIR}/Utilities/Scripts/python_package_updater.py


${PYTHONSLICER_EXECUTABLE} ${UPDATER_SCRIPT} \
  -s ${EXTENSION_SOURCE_DIR}/SuperBuild      \
  --from-installed-packages
  --path ${PYTHON_INSTALL_PREFIX}/lib/python3.9/site-packages
```

This addresses the issue initiated here: DCBIA-OrthoLab#55

Co-authored-by: James Fishbaugh <james.fishbaugh@kitware.com>
jcfr added a commit to jcfr/ShapeVariationAnalyzer that referenced this issue Apr 6, 2022
…d of 3.6

This commit fixes the following build error:

```
  Command failed: 1

   '/Volumes/D/P/S-0-build/python-install/bin/PythonSlicer' '-m' 'pip' 'install' '--require-hashes' '-r' '/.../ShapeVariationAnalyzer-build/python-ShapeVariationAnalyzer-requirements-requirements.txt' '--prefix' '/.../ShapeVariationAnalyzer-build/python-packages-install'

  See also

    /.../ShapeVariationAnalyzer-build/python-ShapeVariationAnalyzer-requirements-prefix/src/python-ShapeVariationAnalyzer-requirements-stamp/python-ShapeVariationAnalyzer-requirements-install-*.log
```

The updates was performed following these steps using the updated
"python_package_updater.py" script assocated with PR Slicer/Slicer#6300:

```
# Set common variables
SLICER_SOURCE_DIR=~/Projects/Slicer
SLICER_DIR=~/Projects/Slicer-Release/Slicer-build
PYTHONSLICER_EXECUTABLE=${SLICER_DIR}/../python-install/bin/PythonSlicer

EXTENSION_SOURCE_DIR=/home/jcfr/Projects/ShapeVariationAnalyzer
EXTENSION_BINARY_DIR=/home/jcfr/Projects/ShapeVariationAnalyzer-Release

# Install packages into the prefix
PYTHON_INSTALL_PREFIX=${EXTENSION_BINARY_DIR}/python-packages-install
${PYTHONSLICER_EXECUTABLE} -m pip install --prefix ${PYTHON_INSTALL_PREFIX} scikit_learn

# Update extension external projects
UPDATER_SCRIPT=${SLICER_SOURCE_DIR}/Utilities/Scripts/python_package_updater.py


${PYTHONSLICER_EXECUTABLE} ${UPDATER_SCRIPT} \
  -s ${EXTENSION_SOURCE_DIR}/SuperBuild      \
  --from-installed-packages                  \
  --path ${PYTHON_INSTALL_PREFIX}/lib/python3.9/site-packages
```

This addresses the issue initiated here: DCBIA-OrthoLab#55

Co-authored-by: James Fishbaugh <james.fishbaugh@kitware.com>
@jamesobutler
Copy link
Contributor Author

Closed by 03a9b78.

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