How to Check Python Version | Windows, macOS, or Linux
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:
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
python -V
python -VV
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:
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
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:
Step 02: Enter the following commands
python –version
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 :
Visit the previous tutorial to learn about how to run a Python script.
Author of Get Basic Idea – Knowledge Base / B.Sc.Hons Degree, Information Technology, and Management.