Symlink python3 command to run python 3.8 (or any latest python versions)

Symlink python3 command to run python 3.8 (or any latest python versions)

First check which python version you need by running-

$ ls /usr/bin/python3*
/usr/bin/python3    /usr/bin/python3.5-config  /usr/bin/python3.5m-config  /usr/bin/python3.7-config  /usr/bin/python3.7m-config  /usr/bin/python3.8-config  /usr/bin/python3m
/usr/bin/python3.5  /usr/bin/python3.5m        /usr/bin/python3.7          /usr/bin/python3.7m        /usr/bin/python3.8          /usr/bin/python3-config    /usr/bin/python3m-config

Now, to symlink python 3.8 to python, execute the following command-

$ ln -sf /usr/bin/python3.8 /usr/bin/python3

The command would have added a symlink of python3.8 to python3. To verify the same, run the command-

$ /usr/bin/python3 --version
Python 3.8.2

or even run the python3 command directly-

$ python3 --version
Python 3.8.2

It's as easy as this! Happy Coding!