To check the version of one's Python's Software version, one should use the following code in command prompt:

python -V

Reference: http://docs.python.org/using/cmdline.html#generic-options

Answer from theglauber on Stack Overflow
🌐
SuperOps
superops.com › superops blog › blog › how to check the python version?
How to check the Python version in quick and easy steps
4 days ago - -Run your code or check the terminal by typing the “python --version” command to confirm the active Python version in VS Code. To update Python, simply download and install the latest version from the official site or use your system’s ...
People also ask

How to check the Python version on CMD?
To check the Python version in Windows Command Prompt, open CMD and enter “python --versionorpython -V.” These commands will display the Python version that is installed on your system. Additionally, if you have multiple Python versions installed on your system, you may need to use the “python3 --version” command to display the installed version of Python 3.
🌐
superops.com
superops.com › superops blog › blog › how to check the python version?
How to check the Python version in quick and easy steps
How to check if Python is installed on Windows?
To check if Python is installed on Windows, open Command Prompt and type “python --version.” If Python is installed and added to your system’s PATH, the command will display the installed Python version. If you get an error saying the command is not recognized, Python is either not installed or not added to the PATH.
🌐
superops.com
superops.com › superops blog › blog › how to check the python version?
How to check the Python version in quick and easy steps
How do I check all my Python versions?
If you have multiple Python versions installed on your computer, and you want to check them all, follow these steps:\n1\n.\n For Windows users\n-Open Command Prompt or PowerShell and run the command “where python.”\n-This command will list all the python.exe paths found in directories listed in your system’s PATH environment variable.\n-After finding all Python executables or paths, you can check the version of each separately.\n-If you have Python Launcher installed on your system, run the command “py -0”\n-This prints all Python versions the launcher can detect.\n2. For Linux and MacOS users
🌐
superops.com
superops.com › superops blog › blog › how to check the python version?
How to check the Python version in quick and easy steps
🌐
bodHOST
bodhost.com › tutorial › how to check python version in linux & windows
How to Check Python Version in Linux & Windows | bodHOST
November 7, 2024 - py --version # Shows default Python version py -0 # Lists ALL installed Python versions py -3 # Runs latest Python 3 version · The Python Launcher (`py`) in Windows makes it easy to manage multiple Python versions.
🌐
Linuxize
linuxize.com › home › python › how to check python version
How to Check Python Version | Linuxize
March 10, 2026 - How do I check the Python version in Linux? Run python3 --version in the terminal. This prints the installed Python 3 version.
🌐
Note.nkmk.me
note.nkmk.me › home › python
Check Python Version on Command Line and in Scripts | note.nkmk.me
April 23, 2025 - ... For related topics, such as ... following articles. ... Run the python or python3 command with the --version or -V option in the Command Prompt (cmd) on Windows or the Terminal on macOS and Linux....
🌐
Syncro
syncrosecure.com › home › blog › how to check python version
How to Check Python Version | Syncro
April 25, 2025 - Open your terminal or command prompt. Type one of the following commands and press Enter: ... Many systems use python3 to differentiate from Python 2. To check the Python version along with environment details: python -VV · This provides detailed version and build information, which can help diagnose platform-specific issues.
Find elsewhere
🌐
Linode
linode.com › docs › guides › check-python-version
How to Check Which Python Version Is Installed | Linode Docs
August 15, 2022 - The Python command comes with a command line option of --version that allows you to see your installed version. It works just as straightforwardly as it sounds. Enter the following command from your command line, and you should get an output ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › check-the-version-of-the-python-interpreter
How to check Python Version : Windows, Linux and Mac - GeeksforGeeks
December 17, 2025 - We can also find the Python version in the interactive shell. Open the Command Prompt and enter one of the following commands: ... We can use the following methods to check the Python version on Linux systems like Ubuntu, Debian, Arch, etc. These methods can be used to find Python version: ... The command line provides a straightforward way to get the Python version. Open your terminal and use this simple check Python version command:
🌐
UltaHost
ultahost.com › knowledge-base › check-python-version-linux-windows
How to Check Python Version in Linux & Windows | Ultahost Knowledge Base
November 30, 2024 - You can check if Python is installed by running python –version or python -V in the terminal (or command prompt). If Python is installed, it will display the version number; otherwise, it will prompt an error indicating that the command is ...
🌐
Lightnode
go.lightnode.com › tech › check-python-version-linux-windows
How to Check Python Version on Linux and Windows
To check the default version of Python installed, simply open the terminal and run the following command: ... This command will return the version of Python 2.x if it is set as the default, which is still the case on some older Linux distributions.
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to check python version in linux, windows, and macos
How to Check Python Version in Windows, Linux, and macOS
December 19, 2025 - If you are using a Mac, check the Python version by running the following command in the terminal: ... The system reports the installed version. Python 2 and Python 3 are separate programs, allowing users to run Python 2 and Python 3 installations separately on the same system. Python 3 is not entirely backward compatible. Most systems differentiate Python 2 as python and Python 3 as python3. If you do not have Python 2, your system may use the python command in place of python3, as shown in the Windows example. However, in Linux and macOS, if you need to check the Python 2 version, enter:
🌐
Red Hat
access.redhat.com › solutions › 1126333
How to check what python version is running on the system - Red Hat Customer Portal
August 5, 2024 - But when running the following command, I still get the Python 2.6.6 version: [root@server Python-3.4.1]# python -V Python 2.6.6 · How do I make sure if Python 3.3.2 has been installed successfully? Red Hat Enterprise Linux (RHEL) 6 Red Hat Software Collections (RHSCL) A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.
🌐
CyberPanel
cyberpanel.net › blog › how-to-check-python-version
Quick Ways to Check Python Version on Mac, Windows & Linux
May 17, 2025 - Most Linux Distributions come with a preinstalled Python version, Now to check which version of Python is installed on Linux simply do this: Open a Terminal window (you can frequently use the Ctrl+Alt+T shortcut)
🌐
RoseHosting
rosehosting.com › home › how to check python version on linux
How to Check Python Version on Linux | RoseHosting
June 10, 2024 - For the older Python version, for Python 2 installations, you can type the following command in the terminal: ... This will display the installed Python version, such as Python 2.7.18. To check the version the installed Python3 version, open your terminal or command prompt and type the following command:
🌐
DataCamp
datacamp.com › tutorial › check-python-version
How to Check Python Version: Windows, macOS, and Linux | DataCamp
January 28, 2026 - You can run python --version or python3 --version in the terminal to check the Python version. If you are using macOS or Linux systems, python and python3 commands often refer to separate Python installations.
🌐
Quora
quora.com › How-do-you-check-if-Python-is-installed-in-Ubuntu
How to check if Python is installed in Ubuntu - Quora
If Python is installed, the path to the executable will be printed to the terminal. If it’s not installed, nothing will happen. To check the version, use this: python --version (or python3 --version)
Top answer
1 of 9
116

You can use python -V (et al.) to show you the version of Python that the python command resolves to. If that's all you need, you're done. But to see every version of python in your system takes a bit more.

In Ubuntu we can check the resolution with readlink -f $(which python). In default cases in 14.04 this will simply point to /usr/bin/python2.7.

We can chain this in to show the version of that version of Python:

$ readlink -f $(which python) | xargs -I % sh -c 'echo -n "%: "; % -V'
/usr/bin/python2.7: Python 2.7.6

But this is still only telling us what our current python resolution is. If we were in a Virtualenv (a common Python stack management system) python might resolve to a different version:

$ readlink -f $(which python) | xargs -I % sh -c 'echo -n "%: "; % -V'
/home/oli/venv/bin/python: Python 2.7.4

This is real output.

The fact is there could be hundreds of different versions of Python secreted around your system, either on paths that are contextually added, or living under different binary names (like python3).

If we assume that a Python binary is always going to be called python<something> and be a binary file, we can just search the entire system for files that match those criteria:

$ sudo find / -type f -executable -iname 'python*' -exec file -i '{}' \; | awk -F: '/x-executable; charset=binary/ {print $1}' | xargs readlink -f | sort -u | xargs -I % sh -c 'echo -n "%: "; % -V'
/home/oli/venv/bin/python: Python 2.7.4
/media/ned/websites/venvold/bin/python: Python 2.7.4
/srv/chroot/precise_i386/usr/bin/python2.7: Python 2.7.3
/srv/chroot/trusty_i386/usr/bin/python2.7: Python 2.7.6
/srv/chroot/trusty_i386/usr/bin/python3.4: Python 3.4.0
/srv/chroot/trusty_i386/usr/bin/python3.4m: Python 3.4.0
/usr/bin/python2.7: Python 2.7.6
/usr/bin/python2.7-dbg: Python 2.7.6
/usr/bin/python3.4: Python 3.4.0
/usr/bin/python3.4dm: Python 3.4.0
/usr/bin/python3.4m: Python 3.4.0
/web/venvold/bin/python: Python 2.7.4

It's obviously a pretty hideous command but this is again real output and it seems to have done a fairly thorough job.

2 of 9
68

Type following in the terminal (Ctrl+Alt+T):

python -V

or

python --version

You can find a list of options/parameters for many commands in the terminal by typing the command followed by --help

Example:

python --help

Manual/manpages also available for most of such CLI which can be displayed by man <command> (Ex: man python)

From man python:

COMMAND LINE OPTIONS
        -V ,  --version
              Prints the Python version number of the executable and exits.

There is also python3 installed on many machines, so you can do:

python3 --version

to find out what python 3.x you are running.

🌐
Cantech
cantech.in › home › how to check python version on windows, linux, and macos
How to Check Python Version on Windows, Linux, and MacOs
July 24, 2024 - To check the Python version in the cmd, you need to follow the below instructions: For Windows – Open the Command Prompt and type python –version or python -V, then press Enter.
🌐
freeCodeCamp
freecodecamp.org › news › check-python-version-how-to-check-py-in-mac-windows-and-linux
Check Python Version – How to Check Py in Mac, Windows, and Linux
July 7, 2023 - In the terminal, type the following command and press Enter: ... This command will display the Python version installed on your system. Note: Some Linux distributions, such as Ubuntu, may have both Python 2 and Python 3 installed. In that case, the above command may display the version of Python 2. To check the version of Python 3, you can use the following command: