This guide covers how to install SageMaker Python SDK V3 and set up your development environment.
Install the latest version of SageMaker Python SDK V3:
pip install sagemaker- Python Version
- SageMaker Python SDK V3 supports Python 3.9, 3.10, 3.11, and 3.12
- Operating Systems
- Linux
- macOS
Install the complete SageMaker Python SDK V3:
pip install sagemakerInstall specific components based on your needs:
# Core functionality only
pip install sagemaker-core
# Training capabilities
pip install sagemaker-train
# Inference capabilities
pip install sagemaker-serve
# ML Operations
pip install sagemaker-mlopsCreate an isolated environment for your SageMaker projects:
# Using venv
python -m venv sagemaker-v3-env
source sagemaker-v3-env/bin/activate
pip install sagemaker
# Using conda
conda create -n sagemaker-v3 python=3.10
conda activate sagemaker-v3
pip install sagemakerInstall the SageMaker Python SDK directly from source when you want to:
- develop locally,
- test your own modifications, or
- work with the latest unreleased features.
git clone https://github.com/aws/sagemaker-python-sdk.git
cd sagemaker-python-sdk
pip install -e .This installs the top-level sagemaker package in editable mode, so any changes you make to its code are picked up immediately without needing to reinstall.
Working with SDK Submodules
The repository contains additional installable components such as:
- sagemaker-core
- sagemaker-train
- sagemaker-serve
- sagemaker-mlops
If you plan to modify code inside one of these packages, install that submodule in editable mode as well:
cd sagemaker-core
pip install -e .Repeat for any other submodule you are actively developing.
Editable installations operate at the Python package level, not the Git repository level. Installing the relevant submodule ensures your local changes are reflected during development.
Verify your installation:
from sagemaker.core.helper.session_helper import Session
from importlib.metadata import version
print(f"SageMaker SDK version: {version('sagemaker')}")
session = Session()
print(f"Default bucket: {session.default_bucket()}")
print(f"Region: {session.boto_region_name}")If you have SageMaker Python SDK V2 installed:
# Upgrade to V3
pip install --upgrade sagemaker
# Or install V3 in a new environment (recommended)
python -m venv sagemaker-v3-env
source sagemaker-v3-env/bin/activate
pip install sagemakerNote: V3 introduces breaking changes. See the :doc:`overview` page for migration guidance.
After installation:
- Configure AWS credentials if you haven't already
- Read the :doc:`overview` to understand V3 changes
- Try the :doc:`quickstart` guide
- Explore :doc:`training/index`, :doc:`inference/index`, and other capabilities