Skip to content

Instantly share code, notes, and snippets.

@naggie
Created November 16, 2021 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naggie/c553269d2a7cfefe48cbbb39a83a1b14 to your computer and use it in GitHub Desktop.
Save naggie/c553269d2a7cfefe48cbbb39a83a1b14 to your computer and use it in GitHub Desktop.
install-python3.7.sh
#!/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