Install & Compatibility
Where this runs
tested against v1.43.81 · 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
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 22.7MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 3.6s · import 0.000s · 23MB
21MB installed
● package 21MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
SageMakerClient
✓ from mypy_boto3_sagemaker import SageMakerClient
✗ from mypy_boto3_sagemaker import SageMakerClient
This quickstart demonstrates how to instantiate a type-hinted SageMaker client using `boto3` and `mypy-boto3-sagemaker`. The `SageMakerClient` type provides comprehensive type checking and auto-completion for all available SageMaker API operations and their parameters.
import boto3
from boto3.session import Session
from mypy_boto3_sagemaker.client import SagemakerClient
def get_sagemaker_client() -> SagemakerClient:
# boto3 automatically picks up credentials from environment variables or AWS config.
# For local testing without actual AWS calls, ensure 'boto3' is configured.
session = Session()
client: SagemakerClient = session.client("sagemaker")
return client
# Example usage (will only run if AWS credentials are set up)
if __name__ == "__main__":
try:
sagemaker_client = get_sagemaker_client()
# Access type-hinted methods, e.g., sagemaker_client.list_training_jobs()
print(f"Successfully created SageMaker client: {sagemaker_client.meta.region_name}")
# Uncomment below to make an actual API call (requires permissions)
# response = sagemaker_client.list_training_jobs(MaxResults=1)
# print(f"Training jobs: {response.get('TrainingJobSummaries')}")
except Exception as e:
print(f"Error creating SageMaker client or making call: {e}")
Debug
Known issues
breakingStarting with `mypy-boto3-builder` version 8.12.0 (which generates these stubs), Python 3.8 support has been removed across all packages. Additionally, packages migrated to follow PEP 561 distribution standards.fixEnsure your project uses Python 3.9 or higher. For older Python versions, use an older `mypy-boto3-sagemaker` release compatible with Python 3.8 (e.g., from `mypy-boto3-builder < 8.12.0`).
affects: mypy-boto3-builder >= 8.12.0 (generating mypy-boto3-sagemaker >= 1.42.88)
breakingBreaking changes in TypeDef naming conventions were introduced in `mypy-boto3-builder` 8.9.0. This includes shorter names for packed method arguments (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`) and moving `Extra` postfixes in conflicting TypeDefs (e.g., `CreateDistributionExtraRequestTypeDef` -> `CreateDistributionRequestExtraTypeDef`).fixReview and update explicit `TypeDef` imports and usage if you were relying on the older naming conventions. Refer to the specific service module's `type_defs` for the updated names.
affects: mypy-boto3-builder >= 8.9.0 (generating mypy-boto3-sagemaker >= 1.42.88)
gotchaPylint may issue `undefined-variable` warnings when using `TYPE_CHECKING` blocks to conditionally import `mypy-boto3-*` types. This is a known issue with Pylint's handling of `TYPE_CHECKING`.fixTo fix this, explicitly set types to `object` in the `else` branch of the `TYPE_CHECKING` block. Example: `if TYPE_CHECKING: from mypy_boto3_sagemaker.client import SagemakerClient else: SagemakerClient = object`.
affects: All versions
gotchaPyCharm users might experience slow performance with Literal overloads in `boto3-stubs`. This is a known IDE issue (PY-40997).fixIf experiencing performance issues in PyCharm, consider installing the 'lite' version of `boto3-stubs` (e.g., `pip install boto3-stubs-lite[sagemaker]`) which provides type annotations without session.client/resource overloads but requires more explicit type annotations.
affects: All versions, specific to PyCharm IDE
deprecatedThe `sms-voice` service was deprecated and removed from `mypy-boto3-builder` in version 8.11.0. Users of this service should migrate to `pinpoint-sms-voice`.fixIf you were using stubs for `sms-voice`, switch to using stubs for `pinpoint-sms-voice` instead.
affects: mypy-boto3-builder >= 8.11.0
Upgrade
Version history
1.43.81latest on PyPI · released Aug 26, 2026
Audit
Dependencies
boto3requiredThis package provides type annotations for the 'boto3' library; 'boto3' itself is required for runtime AWS interaction.