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.
RELATED: What Is Python?
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
To start, open your “Start” menu and search for “Windows PowerShell” (without quotes). Then click the utility in the search results.
When PowerShell opens, type the following command and press Enter:
PowerShell will display the version of Python installed on your PC.
And that’s it.
RELATED: How to Install Python on Windows
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.
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.