{"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,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","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,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}