Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

get_base_python_image_uri() returns URIs for unsupported Python versions

未关闭 适合新手
#6,539 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@Fire162 已经在做这个了。

开始于 2026年10月29日。

  • #6547 来自 @Fire162 —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
74/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
aws, python

调研方向

在 SageMaker Python SDK V3 代码中找到 get_base_python_image_uri() 并阅读其 docstring,其中说明支持的值是 310 和 38。查看附近的测试,了解 Python 版本和镜像 URI 的处理方式。完成标准是明确拒绝 311 等不受支持的版本,同时 310 和 38 仍能生成预期的 URI。

由索引模型根据 Issue 内容生成。

描述

PySDK Version

  • PySDK V2 (2.x)
  • PySDK V3 (3.x)

Describe the bug
The get_base_python_image_uri() function returns image URIs for Python versions that don't have corresponding base images in ECR. When these URIs are used in SageMaker jobs, they fail with image not found errors.

To reproduce

from sagemaker.core.image_uris import get_base_python_image_uri

# Request Python 3.11 base image - THIS FAILS
uri_311 = get_base_python_image_uri(region="us-east-1", py_version="311")
print(f"Python 3.11 URI: {uri_311}")
# Attempt to use this URI in a SageMaker job will fail

# Request Python 3.10 base image - THIS WORKS
uri_310 = get_base_python_image_uri(region="us-east-1", py_version="310")
print(f"Python 3.10 URI: {uri_310}")
# Works fine with SageMaker jobs

Only Python 3.8 and 3.10 have corresponding base images in ECR. Attempting to use Python 3.11, 3.13, or any other unsupported version results in a failure when the SageMaker job tries to pull the image.

Expected behavior
The function should either:

  1. Only accept Python versions for which base images actually exist in ECR (currently 3.8 and 3.10)
  2. Raise a clear ValueError listing the supported Python versions
  3. Update the docstring to document which Python versions are supported

Screenshots or logs

Error occurs only when using unsupported Python versions (e.g., 3.11):

botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the CreateTrainingJob operation: Cannot find the requested image: 012345678901.dkr.ecr.us-west-2.amazonaws.com/sagemaker-base-python-311:1.0 with tag: 1.0 and digest: null. Please check if your ECR image exists and role arn:aws:iam::123456789012:role/SM-Training-ABCDEFGHIJ has proper pull permissions for SageMaker: ecr:BatchCheckLayerAvailability, ecr:BatchGetImage, ecr:GetDownloadUrlForLayer

The issue is that the base image sagemaker-base-python-311 does not exist in ECR. Using Python 3.10 works without this error.

System information

  • SageMaker Python SDK version: 3.x
  • Framework name: N/A (base Python image issue)
  • Framework version: N/A
  • Python version: 3.11, 3.13 (attempted), 3.10 working
  • CPU or GPU: N/A
  • Custom Docker image: N/A

Additional context
The function's docstring states "Can be 310 or 38", but the function accepts any string value for py_version without validation. This creates a discrepancy between documented and actual supported versions, and affects automated image discovery.

主要语言
Python
星标
2.3k
派生
1.3k
平均合并
1 天 23 小时
30 天内合并 PR
81

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

aws/sagemaker-python-sdk 的其他 Issue

查看 aws/sagemaker-python-sdk 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。