In this post, I will show you how you can update or install Python 3.8 on Linux. Let us first download the Python 3.8 tar file.
wget https://www.python.org/ftp/python/3.8.3/Python-3.8.3.tgz
Now do following steps to configure the Python 3.8
tar -xvf Python-3.8.3.tgz
cd Python-3.8.3
./configure --enable-optimizations
At this point, You can run "make altinstall" to make it default version of Python in your system. I don't want to make it default, therefore I am running "make install"
make install
If everything above works fine, You will see Python 3.8 in following directory...
/usr/local/bin/python3.8
Let us set the alias.
alias python3.8=/usr/local/bin/python3.8
Check the version by running following command.
python3.8 --version
> Python 3.8.3
Let us set up the pip now. Pip is also in following directory...
/usr/local/bin/pip3.8
alias pip3.8=/usr/local/bin/pip3.8
Note: Add the above aliases in your ~/.bashrc or ~/.zshrc, otherwise these aliases wouldn't work next time you open a new term or login in to your system.
Note: When you try to use pip, you might get following warning message...
WARNING: You are using pip version 19.2.3, however version 20.2.1 is available. I would recommend to Update Pip.