How to Install an Old Version of Python on Debian or Ubuntu


Install Necessary Libs

Update your package manager and install required packages to build python.

$ sudo apt-get update
$ sudo apt-get install -y make build-essential libssl-dev zlib1g-dev \
    libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
    libncurses5-dev libncursesw5-dev xz-utils tk-dev libgdbm-dev \

Download Python Source Tarball

Say you want to install python 3.7.3, download the source tarball (note that the link is case sensitive).

$ wget

Feel free to browse for other versions.

Build and Install

After downloaded, unzip it and enter the source directory.

$ tar -zx -f Python-3.7.3.tgz
$ cd Python-3.7.3

Then start building.

$ ./configure
$ make
$ sudo make install
GitHub | Email me