Sagemaker lifecycle configuration for installing pandas not working

Solution 1:

if you want to install the packages only in for the python3 environment, use the following script in your Create Sagemaker Lifecycle configurations.

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

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

# Replace myPackage with the name of the package you want to install.
pip install pandas==0.25.3
# You can also perform "conda install" here as well.
source deactivate
EOF

Reference : "Lifecycle Configuration Best Practices"