Checking the Python version can be done using the command line or terminal on Linux, Mac, and Windows. Here are the steps for each operating system:
On Linux:
Open a terminal and use the following command:
python --version
Or
python -V
This will display the installed Python version.
On Mac:
Open the terminal and enter one of the following commands:
python --version
OR
python -V
On Windows:
Using Command Prompt:
Open the Command Prompt and enter:
python --version
OR
python -V
Using PowerShell:
Open PowerShell and enter:
python --version
OR
python --version
For Python 3:
If you have both Python 2 and Python 3 installed, you might need to use python3
instead of python
:
On Linux, Mac, or Windows:
python3 --version
OR
python3 -V
This will display the version of Python 3 installed on your system.
Note:
If you receive an error or the command is not recognized, it may indicate that Python is not in your system’s PATH. In that case, you might need to provide the full path to the Python executable.
On some systems, the Python executable may be named
python3
instead ofpython
. If the above commands don’t work, try replacingpython
withpython3
.For more detailed information, you can use the following command to get the version and additional details:
python -VV
OR
python --version