@@ -7,6 +7,10 @@ FROM gcr.io/kaggle-images/python-lightgbm-whl:${BASE_IMAGE_TAG}-${LIGHTGBM_VERSI
77{{ end }}
88FROM $ {BASE_IMAGE}:$ {BASE_IMAGE_TAG}
99
10+ #b/415358342: UV reports missing requirements files https://github.com /googlecolab/colabtools/issues/5237
11+ ENV UV_CONSTRAINT= \
12+ UV_BUILD_CONSTRAINT=
13+
1014ADD kaggle_requirements.txt /kaggle_requirements.txt
1115
1216# Freeze existing requirements from base image for critical packages:
@@ -29,39 +33,30 @@ ENV PATH="~/.local/bin:${PATH}"
2933RUN uv pip uninstall --system google-cloud-bigquery-storage
3034
3135# b/394382016: sigstore (dependency of kagglehub) requires a prerelease packages, installing separate.
32- RUN uv pip install --system --force-reinstall --prerelease = allow kagglehub[pandas-datasets,hf-datasets,signing]> = 0 .3.9
33-
34- # b/408284143: google-cloud-automl 2 .0.0 introduced incompatible API changes, need to pin to 1.0.1
36+ # google-cloud-automl 2 .0.0 introduced incompatible API changes, need to pin to 1 .0.1
37+ RUN uv pip install --system --force-reinstall --prerelease = allow kagglehub[pandas-datasets,hf-datasets,signing]> = 0 .3.12 \
38+ google-cloud-automl== 1.0.1
3539
3640# b/408284435: Keras 3.6 broke test_keras.py > test_train > keras.datasets.mnist.load_data ()
3741# See https://github.com /keras-team/keras/commit/dcefb139863505d166dd1325066f329b3033d45a
3842# Colab base is on Keras 3.8 , we have to install the package separately
39- RUN uv pip install --system google-cloud-automl== 1.0.1 google-cloud-aiplatform google-cloud-translate== 3.12.1 \
40- google-cloud-videointelligence google-cloud-vision google-genai " keras<3.6"
43+ RUN uv pip install --system " keras<3.6"
4144
4245# uv cannot install this in requirements.txt without --no-build-isolation
4346# to avoid affecting the larger build, we'll post-install it.
4447RUN uv pip install --no-build-isolation --system " git+https://github.com/Kaggle/learntools"
4548
46- # b/408281617: Torch is adamant that it can not install cudnn 9.3.x , only 9.1.x , but Tensorflow can only support 9.3.x.
47- # This conflict causes a number of package downgrades, which are handled in this command
48- # b/302136621: Fix eli5 import for learntools
49- RUN uv pip install --system --force-reinstall --extra-index -url https://pypi.nvidia.com " cuml-cu12==25.2.1" \
50- " nvidia-cudnn-cu12==9.3.0.75" scipy tsfresh scikit-learn== 1.2.2 category-encoders eli5
51-
52- RUN uv pip install --system --force-reinstall " pynvjitlink-cu12==0.5.2"
53-
5449# b/385145217 Latest Colab lacks mkl numpy, install it.
5550RUN uv pip install --system --force-reinstall -i https://pypi.anaconda.org /intel/simple numpy
5651
5752# newer daal4py requires tbb>= 2022, but libpysal is downgrading it for some reason
5853RUN uv pip install --system " tbb>=2022" " libpysal==4.9.2"
5954
6055# b/404590350: Ray and torchtune have conflicting tune cli, we will prioritize torchtune.
61- RUN uv pip install --system --force-reinstall --no-deps torchtune
56+ # b/415358158: Gensim removed from Colab image to upgrade scipy
57+ RUN uv pip install --system --force-reinstall --no-deps torchtune gensim
6258
6359# Adding non-package dependencies:
64-
6560ADD clean-layer.sh /tmp/clean-layer.sh
6661ADD patches/nbconvert-extensions.tpl /opt/kaggle/nbconvert-extensions.tpl
6762ADD patches/template_conf.json /opt/kaggle/conf.json
@@ -181,13 +176,13 @@ RUN mkdir -p /root/.jupyter && touch /root/.jupyter/jupyter_nbconvert_config.py
181176 mkdir -p /etc/ipython/ && echo "c = get_config(); c.IPKernelApp.matplotlib = 'inline'" > /etc/ipython/ipython_config.py && \
182177 /tmp/clean-layer.sh
183178
184- # Fix to import bq_helper library without downgrading setuptools
179+ # Fix to import bq_helper library without downgrading setuptools and upgrading protobuf
185180RUN mkdir -p ~/src && git clone https://github.com/SohierDane/BigQuery_Helper ~/src/BigQuery_Helper && \
186181 mkdir -p ~/src/BigQuery_Helper/bq_helper && \
187182 mv ~/src/BigQuery_Helper/bq_helper.py ~/src/BigQuery_Helper/bq_helper/__init__.py && \
188183 mv ~/src/BigQuery_Helper/test_helper.py ~/src/BigQuery_Helper/bq_helper/ && \
189184 sed -i 's/)/packages=["bq_helper"])/g' ~/src/BigQuery_Helper/setup.py && \
190- uv pip install --system -e ~/src/BigQuery_Helper && \
185+ uv pip install --system -e ~/src/BigQuery_Helper "protobuf<3.21" && \
191186 /tmp/clean-layer.sh
192187
193188
0 commit comments