Security, PKI, sys and network admins

How to check installed and used Python version on Linux

How to check Python version on Linux

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:

  • Ubuntu 12.04/14.04 server
  • Ubuntu 12.04/14.04/16.04 desktop

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:

  • Ubuntu 14.04/16.04 server
  • Ubuntu 14.04/16.04/18.04 desktop
  • CentOS 8.2 server

in your terminal, type:

/usr/bin/python3 -V
/usr/bin/python3 --version

Leave a Reply

Your email address will not be published. Required fields are marked *