Skip to content

Instantly share code, notes, and snippets.

@basaks
Last active June 19, 2022 23:53
Show Gist options
  • Save basaks/f9f5a55e709d5b44d53f28fd2b417ac0 to your computer and use it in GitHub Desktop.
Save basaks/f9f5a55e709d5b44d53f28fd2b417ac0 to your computer and use it in GitHub Desktop.
Python3.7 on ubuntu 22.04 Jammy
## Install Python3.7 interpreter on ubuntu 22.04
On a terminal just do the following steps:
Install dependencies:
sudo apt install tar build-essential ch1eckinstall 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.7.9/Python-3.7.9.tgz
tar -xzf Python-3.7.9.tgz
Install python3.7 while keeping python3.10 as the default python3 version on ubuntu 22.04.
cd Python-3.7.9/
./configure --enable-shared --enable-optimizations --prefix=/usr/local LDFLAGS="-Wl,--rpath=/usr/local/lib"
sudo make altinstall
Check it was installed properly:
>> python3.7 -V
Python 3.7.9
Enjoy!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment