Skip to content

Instantly share code, notes, and snippets.

@basaks
Last active August 16, 2024 19:34
Show Gist options
  • Save basaks/0d0b51f1e6ff254f6563456b9ed03550 to your computer and use it in GitHub Desktop.
Save basaks/0d0b51f1e6ff254f6563456b9ed03550 to your computer and use it in GitHub Desktop.
Python3.9 on ubuntu22.04 Jammy
## Install Python3.9 interpreter on ubuntu 22.04
On a terminal just do the following steps:
Install dependencies:
sudo apt install tar build-essential checkinstall libreadline-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 https://www.python.org/ftp/python/3.9.9/Python-3.9.9.tgz
tar -xzf Python-3.9.9.tgz
Install python3.9 while keeping python3.10 as the default python3 version on ubuntu 22.04.
cd Python-3.9.9/ &&
./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.9
Enjoy!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment