To check the Python version on Windows, Mac, or Linux, type “python –version” into PowerShell on Windows, or the Terminal on Linux or Mac. To view the Python 3 version, run “Python3 –version” instead.
To check what version of Python is installed on your Windows, Mac, or Linux computer, all you have to do is run a single command. We’ll show you how to do that as well as what to do if you have multiple Python versions installed.
How to Read the Python Versions
A Python version consists of three values: a major version, a minor version, and a micro version. An example of a Python version is:
In the above version,
3 refers to Python’s major version. The second digit, which is
10, refers to Python’s minor version, and the last digit,
4, indicates the micro version of Python.
Python’s major versions are generally not compatible with each other, but the minor ones are.
Check the Python Version on Windows
On your Windows PC where you’ve installed Python, use the PC’s built-in PowerShell utility to check the version number. You can also use Command Prompt if you want.
To start, open your “Start” menu and search for “PowerShell” (without quotes). Then click the utility in the search results.
When PowerShell opens, enter the Python version command into the window:
PowerShell will display the version of Python installed on your PC.
And that’s it.
View the Python Version on Mac
On your Mac, you’ll use the pre-installed Terminal app to view your Python version.
Launch Terminal by first opening Spotlight (using the Command+Space shortcut) and then searching for and clicking on “Terminal.”
On the Terminal window, type the following command and press Enter:
Your current Python version will be displayed.
Checking the Python Version on Linux
To check the installed Python version on Linux, open a Terminal window (you can often use the shortcut Ctrl+Alt+T), type the following command, and press Enter:
The terminal will output your current Python version.
It is possible that you’ll get an error message if you don’t specify python3. If you do, just run the following alternative command:
What If Your Computer Has Multiple Python Versions Installed?
You could have multiple Python versions installed at the same time on your computer. This is because some apps use the newer Python 3 while others still rely on Python 2.7 in order to run. In this case, to find the version of each instance of Python, you’ll use the following commands.
To check Python 2.7’s version, use this command:
For Python 3, use the following command:
And you’re all set.
Wondering what version of PowerShell you’re running on your PC? It’s equally to find that information.