{"id":1702,"library":"sagemaker","title":"Amazon SageMaker","description":"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.","status":"active","version":"3.7.1","language":"python","source_language":"en","source_url":"https://github.com/aws/sagemaker-python-sdk","tags":["Amazon SageMaker","Machine Learning","AWS"],"install":[{"cmd":"pip install sagemaker","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Amazon SageMaker is built on top of AWS services and uses boto3 for API calls","package":"boto3","optional":false}],"imports":[{"note":"The sagemaker library should be imported directly.","symbol":"sagemaker","correct":"import sagemaker"},{"note":"The SageMaker class should be imported from the top-level sagemaker module.","wrong":"from sagemaker.sagemaker import SageMaker","symbol":"SageMaker","correct":"from sagemaker import SageMaker"}],"quickstart":{"code":"import sagemaker\nfrom sagemaker import get_execution_role\n\nrole = get_execution_role()\nprint(role)","lang":"python","description":"Quickstart example to get the execution role using Amazon SageMaker."},"warnings":[{"fix":"Explicitly set `accept_eula` to `True` in the ModelBuilder's LoRA deployment path.","message":"In 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`.","severity":"breaking","affected_versions":">=3.7.1"},{"fix":"Set the IAM role correctly using the `role` parameter in the `Evaluate` class.","message":"When using the `Evaluate` class, it's essential to set the IAM role correctly to avoid permission errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Use the `ModelTrainer` class instead of the `Estimator` class.","message":"The `Estimator` class is deprecated in favor of the `ModelTrainer` class.","severity":"deprecated","affected_versions":">=3.4.0"}],"env_vars":null,"search_vec":"'3.7.1':23 '3.9':39 'amazon':1,3,17,42 'aw':46 'bug':33 'current':20 'deploy':14 'featur':31 'fix':34 'higher':41 'learn':45 'librari':10 'machin':44 'model':15 'new':30 'open':8 'open-sourc':7 'python':37 'regular':28 'releas':27 'requir':36 'sagemak':2,4,18,43 'sourc':9 'train':12 'version':21,38","created_at":"2026-04-09T03:59:27.895595+00:00","updated_at":"2026-04-16T21:17:37.365970+00:00","problems":[{"fix":"pip install sagemaker","cause":"The Amazon SageMaker Python SDK is not installed in your current Python environment or the selected kernel.","error":"ModuleNotFoundError: No module named 'sagemaker'"},{"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.","cause":"The SageMaker SDK, which relies on `boto3`, cannot find AWS credentials configured in your environment to authenticate with AWS services.","error":"botocore.exceptions.NoCredentialsError: Unable to locate credentials"},{"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'.","cause":"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.","error":"ValueError: RoleArn must be an arn for an IAM role"},{"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', ...)`.","cause":"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.","error":"ValueError: Framework version X.Y is not supported. Please use one of the following versions: [list of versions]"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"3.21.0","cli_name":"","cli_version":null,"type":"library","homepage":"https://aws.amazon.com/sagemaker/","github":"https://github.com/aws/sagemaker-python-sdk","docs":null,"changelog":null,"pypi":"https://pypi.org/project/sagemaker/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["aws","ai-ml","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-27","next_check":"2026-07-28","install_tag":null}}