Skip to content

Instantly share code, notes, and snippets.

@Ruzzz
Last active October 14, 2021 21:30
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 Ruzzz/0bf1b016d3163518f795f20e654b510b to your computer and use it in GitHub Desktop.
Save Ruzzz/0bf1b016d3163518f795f20e654b510b to your computer and use it in GitHub Desktop.
Build Python on Ubuntu

Python-3.7.0 - Ubuntu ??

sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential libbz2-dev libdb5.3-dev libexpat1-dev libffi-dev libgdbm-dev liblzma-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev libssl-dev tcl-dev tk-dev zlib1g-dev tk openssl

cd /opt
sudo curl -sL https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz | sudo tar xJ

cd Python-3.7.0
sudo ./configure --enable-optimizations
sudo make -j4 altinstall

python3.7 -V
which python3.7

Python-3.8.0 - Ubuntu ??

sudo apt update && sudo apt upgrade -y
sudo apt-get install -y build-essential libbz2-dev libc6-dev libffi-dev libgdbm-dev libncursesw5-dev libreadline-gplv2-dev libsqlite3-dev libssl-dev tk-dev zlib1g-dev

cd /opt
sudo curl -sL https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tar.xz | sudo tar xJ

cd Python-3.8.0
sudo ./configure --enable-optimizations
sudo make -j4 altinstall

python3.8 -V
which python3.8

Python-3.10.0 - Ubuntu 20.04

sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential libbz2-dev libffi-dev libgdbm-dev libncurses5-dev libnss3-dev libreadline-dev libsqlite3-dev libssl-dev zlib1g-dev

cd /opt
sudo curl -sL https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz | sudo tar xJ

cd Python-3.10.0
sudo ./configure --enable-optimizations
sudo make -j4 altinstall

python3.10 -V
which python3.10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment