Check Python version

The quickest way to check the Python version is to run this command in the command line:

Another, and quicker way (note the capital v):

Both commands will work on all popular systems: Windows, Linux, and Mac.

More information

You can add another capital v, if you want more information, like the Python version, release date.

It will also display whether you use the 32-bit or 64-bit versions.

Python versions

There are two major Python versions: Python 2 and Python 3 that are not fully compatible.

If both versions are installed on the machine you can check for Python 2 using this command:

or

If you want to check python3 version, use this command:

Check Python version inside the code

To check the version of Python interpreter inside the script you have to import the sys module first, and then display the Python version.

The print function will display this result:

You can also display the system version info:

Result: