如何使用 Docker 在 Vertex AI 中安装和使用 Python 3.9+?

问题描述 投票:0回答:1

所以我在外部组织的GCP项目中工作,政策是没有公共互联网访问可用。我想使用一些不包含在 Vertex 可用的 DL 容器中的 Python 模块,所以唯一的选择是构建并推送一个 docker 容器来为我安装这些模块,然后用它来创建一个 jupyter notebook。

这里有一个问题:我正在尝试安装至少需要 Python 3.9 的某个模块版本,这就是我现在遇到的问题。我已经使用 this 作为我的 Dockerfile 中的参考完成了 Python 3.9 的构建:

FROM gcr.io/deeplearning-platform-release/base-cpu:latest
RUN apt-get update && \
    apt-get install -y software-properties-common && \
    add-apt-repository -y ppa:deadsnakes/ppa && \
    apt-get update && \
    apt install -y python3.9
RUN pip install gower
RUN pip install kmodes
RUN pip install ray
RUN pip install prince==0.9.0

但是我在构建过程中遇到了这个错误:

> [6/6] RUN pip install prince==0.9.0:
#0 1.325 ERROR: Ignored the following versions that require a different python version: 0.8.0 Requires-Python >=3.9,<4.0; 0.8.1 Requires-Python >=3.9,<4.0; 0.8.2 Requires-Python >=3.9,<4.0; 0.8.3 Requires-Python >=3.9,<4.0; 0.9.0 Requires-Python >=3.9,<4.0
#0 1.325 ERROR: Could not find a version that satisfies the requirement prince==0.9.0 (from versions: 0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.2.5, 0.2.6, 0.3.0, 0.3.1, 0.3.2, 0.3.3, 0.3.4, 0.3.5, 0.3.6, 0.3.7, 0.3.8, 0.4.0, 0.4.1, 0.4.2, 0.4.3, 0.4.4, 0.4.5, 0.4.6, 0.4.7, 0.4.8, 0.4.9, 0.4.10, 0.5.2, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.7.0, 0.7.1)
#0 1.326 ERROR: No matching distribution found for prince==0.9.0

所以我假设它没有找到以前安装的 Python 版本,因此无法构建。我想我遗漏了几行和/或说明,它们可以让我正确构建并将其推送到 Container Registry。

非常感谢任何反馈!

python docker google-cloud-platform vertex gcp-ai-platform-notebook
1个回答
0
投票

我们发布了包含 Python 3.10 的 m105 版本。 https://cloud.google.com/deep-learning-containers/docs/release-notes

© www.soinside.com 2019 - 2024. All rights reserved.