Skip to content

Commit

Permalink
compile python3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasfryda committed Dec 13, 2023
1 parent 4e4ef7a commit 2891293
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions docker/scripts/install_python_version
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,32 @@ for python_version in "${array[@]}"; do
if [[ ${major} == "2" ]] ; then pkg_suffix="" ; else pkg_suffix=${major} ; fi

apt-get update

DEBIAN_FRONTEND=noninteractive apt-get -y install python${python_version} python${python_version}-dev python${pkg_suffix}-setuptools
if [[ ${major} -ge 3 && ${minor} -ge 7 ]]; then
DEBIAN_FRONTEND=noninteractive apt-get -y install python${python_version}-distutils
if [[ ${python_version} == "3.6" ]]
then
DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential checkinstall libreadline-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev clang
mkdir /usr/src || true
pushd /usr/src
wget -nv https://www.python.org/ftp/python/3.6.15/Python-3.6.15.tar.xz
echo "bc04aa6c2a1a172a35012abd668538cd Python-3.6.15.tar.xz" > Python-3.6.15.tar.xz.md5
md5sum -c Python-3.6.15.tar.xz.md5 || exit 1 # unexpected checksum
tar xf Python-3.6.15.tar.xz
cd Python-3.6.15
export CC="clang" # needed to avoid SegFault during install
./configure
make
make altinstall
popd
else
DEBIAN_FRONTEND=noninteractive apt-get -y install python${python_version} python${python_version}-dev python${pkg_suffix}-setuptools
if [[ ${major} -ge 3 && ${minor} -ge 7 ]]; then
DEBIAN_FRONTEND=noninteractive apt-get -y install python${python_version}-distutils
fi
fi
apt-get clean
rm -rf /var/cache/apt/*

echo "###### Installing pip for Python ${python_version} ######"
if [[ ${major} == "2" ]] || [[ ${python_version} == "3.5" ]]
if [[ ${major} == "2" ]] || [[ ${python_version} == "3.5" ]] || [[ ${python_version} == "3.6" ]]
then
curl https://bootstrap.pypa.io/pip/${python_version}/get-pip.py --output get-pip.py
python${python_version} get-pip.py
Expand Down

0 comments on commit 2891293

Please sign in to comment.