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
平均合併
2 天 2 小時
30 天內合併 PR
71

環境準備

  • 沒有 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 摘要。