In this short tutorial, I will demonstrate how to install a spcific version of Python on Ubuntu Linux.
Dependencies
Update the apt repositories:
1
|
|
Then install the required dependencies:
1
|
|
Python Versions
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:
1
|
|
Then extract the tarball:
1
|
|
Once it completes, change to the directory:
1
|
|
Installation
Compile and add --enable-optimizations
flag as an argument:
1
|
|
Run make and make install:
1 2 |
|
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:
1
|
|
Then we can test it by running:
1 2 |
|
Thank You
Thanks for reading, feel free to check out my website, feel free to subscribe to my newsletter or follow me at @ruanbekker on Twitter.