Skip to content

Instantly share code, notes, and snippets.

@Ruzzz
Last active October 14, 2021 21:30
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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