Skip to content

Instantly share code, notes, and snippets.

@HYChou0515
Last active April 5, 2021 08:16
Show Gist options
  • Save HYChou0515/0db32f293fc90ab30216f2ef173041c1 to your computer and use it in GitHub Desktop.
Save HYChou0515/0db32f293fc90ab30216f2ef173041c1 to your computer and use it in GitHub Desktop.
Install python from source (debian)
# Reference: https://linuxize.com/post/how-to-install-python-3-9-on-debian-10/
PYVER=3.9.1
# Install the dependencies necessary to build Python:
sudo apt update
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev liblzma-dev
wget https://www.python.org/ftp/python/${PYVER}/Python-{PYVER}.tgz
tar -xf Python-${PYVER}.tgz
cd Python-${PYVER}
./configure --enable-optimizations
make -j $(nproc)
sudo make altinstall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment