Registry / aws / sagemaker

sagemaker

JSON →
library3.21.0pypypi✓ verified 29d ago

Amazon SageMaker is an open-source library for training and deploying models on Amazon SageMaker. The current version is 3.7.1, and it is released regularly with new features and bug fixes. It requires Python version 3.9 or higher.

pip install sagemaker
INSTALL
IMPORT
SIG · SAGEMAKER
S
sagemaker
awspythonv3.21.0
Install
—
Import
8376ms
Disk
426MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 8.376s · 415.6MB
glibc
py 3.10–3.95 runs
timeout
426MB installed
● package 426MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

sagemaker
✓ import sagemaker
The sagemaker library should be imported directly.
SageMaker
✓ from sagemaker import SageMaker
✗ from sagemaker.sagemaker import SageMaker
The SageMaker class should be imported from the top-level sagemaker module.

Quickstart example to get the execution role using Amazon SageMaker.

import sagemaker from sagemaker import get_execution_role role = get_execution_role() print(role)
Debug
Known issues
breakingIn version 3.7.1, the ModelBuilder's LoRA deployment path now respects the user-provided `accept_eula` value. If not set to `True`, it raises a `ValueError`.
fix
Explicitly set `accept_eula` to `True` in the ModelBuilder's LoRA deployment path.
affects: >=3.7.1
gotchaWhen using the `Evaluate` class, it's essential to set the IAM role correctly to avoid permission errors.
fix
Set the IAM role correctly using the `role` parameter in the `Evaluate` class.
affects: all
deprecatedThe `Estimator` class is deprecated in favor of the `ModelTrainer` class.
fix
Use the `ModelTrainer` class instead of the `Estimator` class.
affects: >=3.4.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'sagemaker'
The Amazon SageMaker Python SDK is not installed in your current Python environment or the selected kernel.
fix
pip install sagemaker
botocore.exceptions.NoCredentialsError: Unable to locate credentials
The SageMaker SDK, which relies on `boto3`, cannot find AWS credentials configured in your environment to authenticate with AWS services.
fix
Configure AWS credentials using `aws configure` via the AWS CLI, set `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables, or ensure your execution environment (e.g., SageMaker notebook instance, EC2) has an attached IAM role with appropriate permissions.
ValueError: RoleArn must be an arn for an IAM role
The `role` parameter in SageMaker SDK functions (like `Estimator` or `Session`) expects a full IAM Role ARN (Amazon Resource Name), not just a role name.
fix
Use `sagemaker.get_execution_role()` to automatically fetch the ARN if running in a SageMaker environment, or provide the complete ARN string, e.g., 'arn:aws:iam::123456789012:role/SageMakerExecutionRole'.
ValueError: Framework version X.Y is not supported. Please use one of the following versions: [list of versions]
The specified framework version (e.g., for TensorFlow, PyTorch, MXNet estimators) is not supported by the SageMaker Python SDK or the underlying SageMaker service for the chosen image.
fix
Update the `framework_version` parameter in your estimator definition to one of the supported versions listed in the error message, for example: `sagemaker.tensorflow.TensorFlow(framework_version='2.12', ...)`.
Upgrade
Version history
3.21.0latest on PyPI · released Aug 25, 2026
Audit
Dependencies
boto3requiredAmazon SageMaker is built on top of AWS services and uses boto3 for API calls
Agent activity
20 hits · last 30 days
node
18
OpenAI (training)
1
Resources
sagemaker — pip install sagemaker · libregistry