Skip to content
Advertisement

Why package is not updated even the lifecycle script has been executed successfully in SageMaker?

I wanted to update pandas version in ‘conda-python3’ in SageMaker, I’ve followed the steps in this page, and linked the new configuration to my instance, CloudWatch log shows me the script has been executed successfully, but when I restart my instance and print out the panda version, it’s still showing the old version 0.24.2, I don’t understand why?

enter image description here

This is the script in the lifecycle configuration:

#!/bin/bash
sudo -u ec2-user -i <<'EOF'

pip install pandas

conda update pandas

source deactivate

EOF

Advertisement

Answer

You are not activating any conda environment such as python3.

#!/bin/bash
sudo -u ec2-user -i <<'EOF'

# This will affect only the Jupyter kernel called "conda_python3".
source activate python3

pip install pandas

conda update pandas

source deactivate

EOF
Advertisement