@@ -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:
@@ -27,39 +31,30 @@ RUN uv pip install --system -r /requirements.txt
2731RUN uv pip uninstall --system google-cloud-bigquery-storage
2832
2933# b/394382016: sigstore (dependency of kagglehub) requires a prerelease packages, installing separate.
30- RUN uv pip install --system --force-reinstall --prerelease = allow kagglehub[pandas-datasets,hf-datasets,signing]> = 0 .3.9
31-
32- # b/408284143: google-cloud-automl 2 .0.0 introduced incompatible API changes, need to pin to 1.0.1
34+ # google-cloud-automl 2 .0.0 introduced incompatible API changes, need to pin to 1 .0.1
35+ RUN uv pip install --system --force-reinstall --prerelease = allow kagglehub[pandas-datasets,hf-datasets,signing]> = 0 .3.12 \
36+ google-cloud-automl== 1.0.1
3337
3438# b/408284435: Keras 3.6 broke test_keras.py > test_train > keras.datasets.mnist.load_data ()
3539# See https://github.com /keras-team/keras/commit/dcefb139863505d166dd1325066f329b3033d45a
3640# Colab base is on Keras 3.8 , we have to install the package separately
37- RUN uv pip install --system google-cloud-automl== 1.0.1 google-cloud-aiplatform google-cloud-translate== 3.12.1 \
38- google-cloud-videointelligence google-cloud-vision google-genai " keras<3.6"
41+ RUN uv pip install --system " keras<3.6"
3942
4043# uv cannot install this in requirements.txt without --no-build-isolation
4144# to avoid affecting the larger build, we'll post-install it.
4245RUN uv pip install --no-build-isolation --system " git+https://github.com/Kaggle/learntools"
4346
44- # 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.
45- # This conflict causes a number of package downgrades, which are handled in this command
46- # b/302136621: Fix eli5 import for learntools
47- RUN uv pip install --system --force-reinstall --extra-index -url https://pypi.nvidia.com " cuml-cu12==25.2.1" \
48- " nvidia-cudnn-cu12==9.3.0.75" scipy tsfresh scikit-learn== 1.2.2 category-encoders eli5
49-
50- RUN uv pip install --system --force-reinstall " pynvjitlink-cu12==0.5.2"
51-
5247# b/385145217 Latest Colab lacks mkl numpy, install it.
5348RUN uv pip install --system --force-reinstall -i https://pypi.anaconda.org /intel/simple numpy
5449
5550# newer daal4py requires tbb>= 2022, but libpysal is downgrading it for some reason
5651RUN uv pip install --system " tbb>=2022" " libpysal==4.9.2"
5752
5853# b/404590350: Ray and torchtune have conflicting tune cli, we will prioritize torchtune.
59- RUN uv pip install --system --force-reinstall --no-deps torchtune
54+ # b/415358158: Gensim removed from Colab image to upgrade scipy
55+ RUN uv pip install --system --force-reinstall --no-deps torchtune gensim
6056
6157# Adding non-package dependencies:
62-
6358ADD clean-layer.sh /tmp/clean-layer.sh
6459ADD patches/nbconvert-extensions.tpl /opt/kaggle/nbconvert-extensions.tpl
6560ADD patches/template_conf.json /opt/kaggle/conf.json
@@ -171,13 +166,13 @@ RUN mkdir -p /root/.jupyter && touch /root/.jupyter/jupyter_nbconvert_config.py
171166 mkdir -p /etc/ipython/ && echo "c = get_config(); c.IPKernelApp.matplotlib = 'inline'" > /etc/ipython/ipython_config.py && \
172167 /tmp/clean-layer.sh
173168
174- # Fix to import bq_helper library without downgrading setuptools
169+ # Fix to import bq_helper library without downgrading setuptools and upgrading protobuf
175170RUN mkdir -p ~/src && git clone https://github.com/SohierDane/BigQuery_Helper ~/src/BigQuery_Helper && \
176171 mkdir -p ~/src/BigQuery_Helper/bq_helper && \
177172 mv ~/src/BigQuery_Helper/bq_helper.py ~/src/BigQuery_Helper/bq_helper/__init__.py && \
178173 mv ~/src/BigQuery_Helper/test_helper.py ~/src/BigQuery_Helper/bq_helper/ && \
179174 sed -i 's/)/packages=["bq_helper"])/g' ~/src/BigQuery_Helper/setup.py && \
180- uv pip install --system -e ~/src/BigQuery_Helper && \
175+ uv pip install --system -e ~/src/BigQuery_Helper "protobuf<3.21" && \
181176 /tmp/clean-layer.sh
182177
183178
0 commit comments