Last active
May 15, 2022 14:28
-
-
Save dankkom/ece833b734e2519911f4ab7347188c73 to your computer and use it in GitHub Desktop.
Install Python from source code
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
apt update | |
apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev liblzma-dev | |
PYTHON_VERSION=3.10.1 | |
N_PROCESSORS=$(nproc) | |
wget https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz | |
tar -xf "Python-$PYTHON_VERSION.tgz" | |
cd "Python-$PYTHON_VERSION" | |
./configure --enable-optimizations | |
make -j $N_PROCESSORS | |
make altinstall | |
cd .. | |
rm "Python-$PYTHON_VERSION.tgz" | |
rm -rf "Python-$PYTHON_VERSION" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Check currently available versions at: https://www.python.org/downloads/source/