File tree 1 file changed +15
-2
lines changed
1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -58,9 +58,22 @@ for env in base /home/ec2-user/anaconda3/envs/*; do
58
58
59
59
sudo -u ec2-user -E sh -c 'source /home/ec2-user/anaconda3/bin/activate "$env"'
60
60
61
+ if [ $env = base ]; then
62
+ ENV_PYTHON=python
63
+ else
64
+ ENV_PYTHON="$env/bin/python"
65
+ fi
66
+
67
+ PYTHON_VERSION=$($ENV_PYTHON -c"import sys; print('{}{}'.format(sys.version_info[0], sys.version_info[1]))")
68
+ if [ $PYTHON_VERSION -lt 38 ]; then
69
+ echo "Skipping because $env uses py$PYTHON_VERSION which is incompatible with SageMaker Python SDK"
70
+ sudo -u ec2-user -E sh -c 'source /home/ec2-user/anaconda3/bin/deactivate'
71
+ continue
72
+ fi
73
+
61
74
echo "Updating SageMaker Python SDK..."
62
- pip install --upgrade pip
63
- pip install "$TARBALL_DIRECTORY/sagemaker.tar.gz"
75
+ $ENV_PYTHON -m pip install --upgrade pip
76
+ $ENV_PYTHON -m pip install "$TARBALL_DIRECTORY/sagemaker.tar.gz"
64
77
65
78
sudo -u ec2-user -E sh -c 'source /home/ec2-user/anaconda3/bin/deactivate'
66
79
You can’t perform that action at this time.
0 commit comments