Created
November 16, 2021 13:38
-
-
Save naggie/c553269d2a7cfefe48cbbb39a83a1b14 to your computer and use it in GitHub Desktop.
install-python3.7.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
VERSION=3.7.12 | |
NAME=Python-${VERSION} | |
TGZ_FILE=${NAME}.tgz | |
sudo apt update | |
sudo apt -y install \ | |
build-essential \ | |
curl \ | |
libbz2-dev \ | |
libffi-dev \ | |
liblzma-dev \ | |
libncurses5-dev \ | |
libncursesw5-dev \ | |
libreadline-dev \ | |
libsqlite3-dev \ | |
libssl-dev \ | |
llvm \ | |
tk-dev \ | |
wget \ | |
xz-utils \ | |
zlib1g-dev \ | |
if [ ! -f "$TGZ_FILE" ]; then | |
wget https://www.python.org/ftp/python/${VERSION}/${TGZ_FILE} | |
tar -xf Python-3.7.12.tgz | |
fi | |
cd ${NAME} | |
./configure --enable-optimizations #--enable-shared | |
# altinstal -- don't clobber system python | |
sudo make altinstall | |
# for python mysqlclient, required for vault | |
sudo apt-get install python3-dev default-libmysqlclient-dev build-essential |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment