For system, network and cloud administrators
Knowing which Python version your Linux comes pre-installed with is definitely useful, especially if you’re a system, network admin, developer. Most Linux distributions use multiple Python versions installed on their machine – this being the reason why we’ll learn how to check for Python v2 and v3.
To check for already installed Python v2 for:
type inside your terminal:
/usr/bin/python -V
/usr/bin/python --version
Notice in the above examples, I’ve tested the 1st version of Ubuntu 16.04 LTS and then I’ve updated the OS up until 16.04.6 so that you can see the different Python version.
To check for already installed Python v3 for:
in your terminal, type:
/usr/bin/python3 -V
/usr/bin/python3 --version