{"id":22329,"library":"sagemaker-containers","title":"SageMaker Containers","description":"Open source library for creating containers to run on Amazon SageMaker. Version 2.8.6.post2. This library is deprecated and no longer actively maintained; users should migrate to the SageMaker Training Toolkit and Inference Toolkit.","status":"deprecated","version":"2.8.6.post2","language":"python","source_language":"en","source_url":"https://github.com/aws/sagemaker-containers/","tags":["sagemaker","aws","container","machine-learning","deprecated"],"install":[{"cmd":"pip install sagemaker-containers","lang":"bash","label":"Latest from PyPI"}],"dependencies":[],"imports":[{"note":"Standard import path.","wrong":null,"symbol":"sagemaker_containers","correct":"import sagemaker_containers"},{"note":"Private module, but commonly accessed via underscore prefix.","wrong":"import sagemaker_containers._modules","symbol":"Module","correct":"from sagemaker_containers import _modules"}],"quickstart":{"code":"import sagemaker_containers\n\n# Example: create a training environment\nfrom sagemaker_containers.beta import framework\n\nenv = framework.training_env()\nprint(env.current_host, env.hosts)\n\n# Note: This library is deprecated. Prefer sagemaker-training-toolkit for training containers.","lang":"python","description":"Initialize a SageMaker container environment and print the current host."},"warnings":[{"fix":"Replace imports: 'sagemaker_containers' -> 'sagemaker_training' for training, or 'sagemaker_inference' for inference.","message":"This library is deprecated. Use sagemaker-training-toolkit or sagemaker-inference-toolkit instead.","severity":"deprecated","affected_versions":">=2.8.6.post0"},{"fix":"Avoid relying on beta subpackages; use the stable sagemaker_training toolkit.","message":"The beta subpackage (sagemaker_containers.beta) is not stable and may change.","severity":"gotcha","affected_versions":"all"},{"fix":"Use Python 3.6+ for versions after 2.8.2.","message":"Python 2 support was dropped in later versions. Version 2.8.2 mentioned creating __init__ for Python 2 protobuf import, but newer releases do not support Python 2.","severity":"gotcha","affected_versions":">2.8.2"}],"env_vars":null,"search_vec":"'2.8.6':15 'activ':24 'amazon':12 'aw':38 'contain':2,8,39 'creat':7 'deprec':20,43 'infer':35 'learn':42 'librari':5,18 'longer':23 'machin':41 'machine-learn':40 'maintain':25 'migrat':28 'open':3 'post2':16 'run':10 'sagemak':1,13,31,37 'sourc':4 'toolkit':33,36 'train':32 'user':26 'version':14","created_at":"2026-04-27T17:04:36.019211+00:00","updated_at":"2026-04-27T17:04:36.019211+00:00","problems":[{"fix":"Run 'pip install sagemaker-containers' inside the container.","cause":"Package not installed or environment misconfigured (e.g., running outside SageMaker).","error":"ModuleNotFoundError: No module named 'sagemaker_containers'"},{"fix":"Use 'from sagemaker_training import environment' instead.","cause":"The beta subpackage was removed or renamed in newer releases of the replacement toolkit.","error":"AttributeError: module 'sagemaker_containers' has no attribute 'beta'"},{"fix":"Correct import: 'from sagemaker_containers.beta import framework' then use 'framework.training_env()'.","cause":"Typo or incorrect subpackage path.","error":"ImportError: cannot import name 'training_env' from 'sagemaker_containers.beta.framework'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2.8.6.post2","cli_name":"","cli_version":null,"type":"library","homepage":"https://aws.amazon.com/sagemaker/","github":"https://github.com/aws/sagemaker-containers","docs":null,"changelog":null,"pypi":"https://pypi.org/project/sagemaker-containers/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","aws"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-28","install_tag":null}}