In this short tutorial, I will demonstrate how to install a spcific version of Python on Ubuntu Linux.
Update the apt repositories:
Then install the required dependencies:
Head over to the Python Downloads section and select the version of your choice, in my case I will be using Python 3.8.13, once you have the download link, download it:
Then extract the tarball:
Once it completes, change to the directory:
Compile and add
--enable-optimizations flag as an argument:
Run make and make install:
Once it completes, you can symlink the python binary so that it’s detected by your
PATH, if you have no installed python versions or want to use it as the default, you can force overwriting the symlink:
Then we can test it by running:
Thanks for reading, feel free to check out my website, feel free to subscribe to my newsletter or follow me at @ruanbekker on Twitter.