Describe the bug
When importing the SageMaker Pipelines module the runtime raises:
ModuleNotFoundError: No module named 'pytz'
The SDK imports pytz directly from a pipeline module but does not declare pytz in its own install-time dependencies. If dependency resolution installs pandas>=3.x (which no longer pulls pytz), pytz may be absent and the import fails.
To reproduce
Create a fresh environment and run the following steps (complete and runnable):
- Create and activate a virtualenv, then install the SDK and pandas 3.x:
python -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
pip install "sagemaker==2.257.3" "pandas==3.0.0"
- Create
reproduce.py with this exact content:
# reproduce.py
from sagemaker.workflow.pipeline import Pipeline
print("Imported Pipeline OK")
- Run:
Observed result: import fails with a traceback like:
Traceback (most recent call last):
File "reproduce.py", line 1, in <module>
from sagemaker.workflow.pipeline import Pipeline
File ".../site-packages/sagemaker/workflow/pipeline.py", line XX, in <module>
import pytz
ModuleNotFoundError: No module named 'pytz'
Expected behavior
Importing public SDK modules (e.g., sagemaker.workflow.pipeline) should not raise ModuleNotFoundError for direct imports used by the SDK. Installing the SDK alone should provide all runtime dependencies required by its modules.
Screenshots or logs
See the traceback above produced by the reproduction steps.
System information
- SageMaker Python SDK version:
sagemaker==2.257.3
- Framework name or algorithm: N/A (issue occurs at SDK import time)
- Framework version: N/A
- Python version:
Python 3.12
- CPU or GPU: CPU
- Custom Docker image (Y/N): N
Additional context
- Root cause: Historically
pandas<3 depended on pytz, so pytz was often pulled transitively. With pandas>=3 that transitive dependency is removed, exposing the SDK's missing direct dependency on pytz.
Describe the bug
When importing the SageMaker Pipelines module the runtime raises:
The SDK imports
pytzdirectly from a pipeline module but does not declarepytzin its own install-time dependencies. If dependency resolution installspandas>=3.x(which no longer pullspytz),pytzmay be absent and the import fails.To reproduce
Create a fresh environment and run the following steps (complete and runnable):
reproduce.pywith this exact content:Observed result: import fails with a traceback like:
Expected behavior
Importing public SDK modules (e.g.,
sagemaker.workflow.pipeline) should not raiseModuleNotFoundErrorfor direct imports used by the SDK. Installing the SDK alone should provide all runtime dependencies required by its modules.Screenshots or logs
See the traceback above produced by the reproduction steps.
System information
sagemaker==2.257.3Python 3.12Additional context
pandas<3depended onpytz, sopytzwas often pulled transitively. Withpandas>=3that transitive dependency is removed, exposing the SDK's missing direct dependency onpytz.