Files
runner-images-PK/images/linux/scripts/installers/python.sh
T

29 lines
962 B
Bash
Raw Normal View History

#!/bin/bash
################################################################################
## File: python.sh
2019-12-16 13:47:05 -05:00
## Desc: Installs Python 2/3
################################################################################
2020-09-30 16:19:28 +03:00
set -e
# Source the helpers for use with the script
+13
2020-05-26 18:45:48 +03:00
source $HELPER_SCRIPTS/os.sh
# Install Python, Python 3, pip, pip3
+13
2020-05-26 18:45:48 +03:00
if isUbuntu16 || isUbuntu18 ; then
apt-get install -y --no-install-recommends python python-dev python-pip python3 python3-dev python3-pip
fi
2020-09-30 16:19:28 +03:00
if isUbuntu20 ; then
apt-get install -y --no-install-recommends python3 python3-dev python3-pip python-is-python3
ln -s /usr/bin/pip3 /usr/bin/pip
fi
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
for cmd in python pip python3 pip3; do
if ! command -v $cmd; then
echo "$cmd was not installed or not found on PATH"
exit 1
fi
done