How to Check Python Version | Windows, macOS, or Linux

How to Check Python Version

Python is one of the most popular programming languages. Like other programming languages, Python also has different versions. But the most popular versions are Python 2.7.x and Python 3.7.x. Here x means the revision level and it could be changing with new releases. So, in this article, you will be able to learn how to check the Python version on your operating system using the command line. You can check the version by using the following steps.

How to Check Python Version in Windows

Step 01: Open Windows Powershell

Before checking the version, you need to open PowerShell or a command prompt on your PC.

To access the PowerShell Window:

How to open powershell in windows

Step 02: Enter the following commands

In the Windows operating system, You can check the version by using three different ways. They are:

python –version

check python version in Windows method 1

python -V

check python version in Windows method 2

python -VV

check python version in Windows method 3

By using the above commands you can check the version on your Windows operating system. All of these three commands are given the same output.

How to Check Python Version in macOS

Step 01: Open the Terminal

To access the terminal in macOS:

How to open terminal

Step 02: Enter the following commands

If you are using a macOS, by entering the following commands you can check the version that already exists in your operation system.

python –version

check python version in macOS

If you see something like this, your operating system already installed python.

Check Python Version in Linux

Most of the modern Linux operating systems come with Python pre-installed. However, to check the Python version installed, do the following steps.

Step 01: Open the Bash window

To access the Bash window in Linux:

how to open Bash window

Step 02: Enter the following commands

python –version

check python version in Linux OS

If your command line displays an error that means your PC doesn't have any version installed. If you need to install Python for the operating system you can use the below links:

………………………………………………………………………………………………………………………………………………

Quick Overview :

summary about commands

Visit the previous tutorial to learn about how to run a Python script.

Sandali Wijerathna

Author of Get Basic Idea - Knowledge Base / B.Sc.Hons Degree, Information Technology, and Management.

Leave a Reply

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