Created
November 26, 2021 08:44
-
-
Save naggie/494bfdce8a66c3f659c966b2887d9a57 to your computer and use it in GitHub Desktop.
install python 3.9
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.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