Skip to content

Instantly share code, notes, and snippets.

Last active September 29, 2023 18:23
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save basaks/652eea861a143a9b3d11805c96273488 to your computer and use it in GitHub Desktop.
Install python3.9 on ubuntu 18.04
## Install Python3.9 interpreter on ubuntu 18.04
[From here](, we can pretty much follow the exact same procedure.
Only this I needed to on top of that blog was the `libffi-dev` system dependency.
On a terminal just do the following steps:
Install dependencies:
sudo apt install build-essential checkinstall libreadline-gplv2-dev \
libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev \
libbz2-dev openssl libffi-dev
Download and untar the desired version:
mkdir -p $HOME/opt
cd $HOME/opt
curl -O
tar -xzf Python-3.9.2.tgz
Install python3.9 while keeping python3.8 as the default python3 version on ubuntu 18.04.
cd Python-3.9.2/
./configure --enable-shared --enable-optimizations --prefix=/usr/local LDFLAGS="-Wl,--rpath=/usr/local/lib"
sudo make altinstall
Check it was installed properly:
>> python3.9 -V
Python 3.9.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment