How to Check Python Version in Linux, Mac, & Windows
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
How to Check Python Version in Linux
Most modern Linux distributions come with Python pre-installed.
To check the version installed, open a terminal window and entering the following:
How to Check Python Version in Windows
Most out-of-the-box Windows installations do not come with Python pre-installed. However, it is always a good idea to check.
Open Windows Powershell, and enter the following:
How to Check Python Version in MacOS
If using a MacOS, check the Python version by entering the following command in the terminal:
learn how to check your Python version in Windows, macOS, and Linux.
How to Check Your Python Version on Windows 10
In Windows 10, we can use the PowerShell to check the version of Python that we are running. In order to access the PowerShell, simply use the following steps:
Windows + R
OK
or hitenter
Once the PowerShell is open you can access the Python version your interpreter is running by writing the commands shown below.
python --version
Python 3.8.5
python -V
Python 3.8.5
python -VV
Python 3.8.5 (default, Sep 4 2020, 02:22:02) [Clang 10.0.0 ]
How to Check Your Python Version on Windows 7
On Windows 7 and earlier, you can use the command prompt to check your Python version. In order to do this, you can run the following steps:
Windows
+R
cmd
OK
or hitenter
Check the table below for the different types of commands you can run in order to check your version of Pyhton on Windows 7:
python --version
Python 3.8.5
python -V
Python 3.8.5
python -VV
Python 3.8.5 (default, Sep 4 2020, 02:22:02) [Clang 10.0.0 ]
How to Check Your Python Version on macOS / Linux:
In macOS and Linux you can use the Terminal application to check your version of Python. On macOS, this can be accomplished by following the steps below:
command
+space
enter
Because some versions of macOS come with Python 2 installed by default, it’s likely that the
python
command may refer to Python 2. Because of this, you may need to runpython3
instead, to refer to that version of Python.The table below breaks down the different commands to run on macOS and Linux to get the version of Python:
python3 --version
Python 3.8.5
python3 -V
Python 3.8.5
python3 -VV
Python 3.8.5 (default, Sep 4 2020, 02:22:02) [Clang 10.0.0 ]
python --version
Python 2.7.18
python -V
Python 2.7.18
How to Check Your Python Version in a Script Using sys
This article will teach you how to check Python version in Linux, Mac, and Windows.
Step 1: Open the Terminal in Mac OS X or Linux.
Step 2: Type python –version to check Python version on Linux and Mac OS X.
Step 3: Type python -V to check Python version on Windows.