A data scientist needs specific Python packages preinstalled on SageMaker notebook instances. What is the recommended way to ensure those packages are installed automatically when a notebook instance starts?
Choose an answer
Tap an option to check your answer.
Correct answer: Create a SageMaker lifecycle configuration that runs the package installation commands and attach it to the notebook instance..
Why this is the answer
Creating a SageMaker lifecycle configuration is the recommended and most automated way to install custom packages. Lifecycle configurations are shell scripts that run when a notebook instance starts (oncreate) or when a notebook is opened (onstart). This ensures consistent package environments across instances and automates setup. Installing the SSM Agent is not the primary or most efficient method for SageMaker notebook instance package management; lifecycle configurations are purpose-built for this. Placing a Jupyter notebook under /etc/init is incorrect; /etc/init is for system initialization scripts, not Jupyter notebooks, and this method wouldn't automatically execute cells. Manually installing packages via conda within the notebook is possible but not automated or scalable for multiple instances or recurring setups.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed