Skip to content

Instantly share code, notes, and snippets.

@naggie
Created November 26, 2021 08:44
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/494bfdce8a66c3f659c966b2887d9a57 to your computer and use it in GitHub Desktop.
Save naggie/494bfdce8a66c3f659c966b2887d9a57 to your computer and use it in GitHub Desktop.
install python 3.9
#!/usr/bin/env bash
set -e
VERSION=3.9.5
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.9.5.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