diff --git a/Dockerfile b/Dockerfile index e9f005e75e..55b093c7ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,12 +26,21 @@ RUN if [[ $(uname -m) =~ "aarch64" ]]; then \ WORKDIR /opt/monai +# Patch NVIDIA's pip constraint file: +# - keep numpy==1.26.4 pin (PyTorch nv25.12 was compiled against NumPy 1.x) +# - add setuptools<71 (newer setuptools removed pkg_resources needed by legacy setup.py) +# - remove jupytext/isort pins so the tutorial runner can install its required versions +RUN grep '^numpy==' /etc/pip/constraint.txt > /tmp/new_constraints.txt \ + && printf 'setuptools<71\n' >> /tmp/new_constraints.txt \ + && cp /tmp/new_constraints.txt /etc/pip/constraint.txt + # install full deps COPY requirements.txt requirements-min.txt requirements-dev.txt /tmp/ RUN cp /tmp/requirements.txt /tmp/req.bak \ && awk '!/torch/' /tmp/requirements.txt > /tmp/tmp && mv /tmp/tmp /tmp/requirements.txt \ && python -m pip install --upgrade --no-cache-dir --no-build-isolation pip wheel wheel-stub \ - && python -m pip install --no-cache-dir --no-build-isolation -r /tmp/requirements-dev.txt + && python -m pip install --no-cache-dir --no-build-isolation -r /tmp/requirements-dev.txt \ + && python -m pip install --no-cache-dir --no-build-isolation papermill jupytext autopep8 autoflake ipywidgets # compile ext and remove temp files # TODO: remark for issue [revise the dockerfile #1276](https://github.com/Project-MONAI/MONAI/issues/1276) diff --git a/requirements-dev.txt b/requirements-dev.txt index 08fcdc2b0e..81fba00f6a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -18,6 +18,7 @@ black>=26.3.1 isort>=5.1, <6, !=6.0.0 ruff>=0.14.11,<0.15 pybind11 +setuptools<71 # pkg_resources removed in setuptools>=71; needed by MetricsReloaded setup.py types-setuptools mypy>=1.5.0, <1.12.0 ninja @@ -33,9 +34,11 @@ tifffile; platform_system == "Linux" or platform_system == "Darwin" pandas requests einops -transformers>=4.53.0 -mlflow>=2.12.2,<3.13 +transformers>=4.53.0, <5.0 # 5.x references torch.float8_e8m0fnu absent in older PyTorch builds +mlflow>=2.12.2, <3.0 # 3.x broken on Python 3.12 (relative import in mlflow.utils.uv_utils) clearml>=1.10.0rc0 +aim; platform_system == "Linux" # experiment tracking backend for spleen_segmentation_aim tutorial +lightning>=2.0 # PyTorch Lightning for lightning-based training tutorials matplotlib>=3.6.3 tensorboardX types-PyYAML