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
1 week ago - With Python's rapid evolution and different projects requiring specific versions, knowing which version you're running prevents compatibility errors and security vulnerabilities. This guide covers command-line methods, IDE checks, virtual environments, and package managers to identify your Python version quickly.
Discussions

How do i check my Python Version Using Command Line.?
You need to have the python.exe path in your PATH environment variable More on reddit.com
๐ŸŒ r/Python
5
0
October 21, 2018
checking the python version on the machine
More likely python3 on a linux distribution. What do you get for, python --version and python3 --version? More on reddit.com
๐ŸŒ r/learnpython
3
2
March 13, 2023
How to check Python version and Install latest one
Did you try using bash script and pyenv to manage and install versions? More on reddit.com
๐ŸŒ r/learnpython
12
1
May 4, 2022
How to check Python version in Conde environment
You can use conda list python which will display all the packages in your conda environment that include the keyword python and their version. More on reddit.com
๐ŸŒ r/learnpython
1
2
October 25, 2023
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 --version โ€ or โ€œpython -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 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
What is a Python version file?
A Python version file is a simple text file that specifies which Python version should be used for a particular project or directory. The file contains a single line with a Python version specification like 3.13.1. It is usually used by Python version managers like pyenv, uv, and others to automatically select and activate the specified Python version whenever you work in that directory.
๐ŸŒ
superops.com
superops.com โ€บ superops blog โ€บ blog โ€บ how to check the python version?
How to check the Python version in quick and easy steps
๐ŸŒ
DataCamp
datacamp.com โ€บ tutorial โ€บ check-python-version
How to Check Python Version: Windows, macOS, and Linux | DataCamp
January 28, 2026 - You can access version details by importing the built-in sys library. The code below displays the full Python version string along with build details. -- Check Python version import sys print(sys.version)
๐ŸŒ
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.
๐ŸŒ
Reddit
reddit.com โ€บ r/python โ€บ how do i check my python version using command line.?
r/Python on Reddit: How do i check my Python Version Using Command Line.?
October 21, 2018 -

Evening r/Python

The reason for this post is because i am having trouble checking my Python version using the command prompt. Am originally a Mac user, so not sure if the PC transition is what has me confused. Anyways, i know i have Python Version 3.7 installed in my system. However, when i run the python --version command line in both the regular command prompt and administrator command prompt, i get THIS error message.

How come.? This is not really about what version I'm running, as it is about me trying to use the pip install command to install packages. But i figured start at the begging so if command prompt won't even recognize my python installation, why first waste my time trying to figure out why is wont recognize the pip call.

Anyhow, any comments/suggestions would be greatly appreciated. Thank you in advance and good day.! Cheers.! :)

๐ŸŒ
Syncro
syncrosecure.com โ€บ home โ€บ blog โ€บ how to check python version
How to Check Python Version | Syncro
April 25, 2025 - On managed systems, package managers can also help identify the installed Python version. For Windows: Use the โ€œwingetโ€ command or check Python via the Apps & Features settings.
Find elsewhere
๐ŸŒ
Note.nkmk.me
note.nkmk.me โ€บ home โ€บ python
Check Python Version on Command Line and in Scripts | note.nkmk.me
April 23, 2025 - print(sys.version_info) # sys.version_info(major=3, minor=11, micro=3, releaselevel='final', serial=0) print(type(sys.version_info)) # <class 'sys.version_info'> ... You can get each value by specifying an index. ... From Python 2.7 and Python 3.1 onwards, elements can be accessed by name, such as major, minor, micro, releaselevel, and serial. ... To determine whether Python 2 or Python 3 is running, check the major version with sys.version_info[0] or sys.version_info.major.
๐ŸŒ
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 - If the python --version command does not work, try using the python3 command instead. Python 3 is the latest major version of Python, and some systems have both Python 2 and Python 3 installed.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ check-version-of-installed-python-modules
Check Version of Installed Python Modules - GeeksforGeeks
September 11, 2025 - We can access this attribute to find the version of the installed package. ... Open the Python interpreter by typing python in the command prompt.
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.

๐ŸŒ
Windows Forum
windowsforum.com โ€บ forums โ€บ windows help and support forums โ€บ windows news
Check Python Version in Windows CMD: Quick Guide to Installers and Py Launcher | Windows Forum
August 26, 2025 - Try py --version to see if the Python launcher is present. If you installed Python yourself, re-run the installer and check Add Python to PATH during setup.
๐ŸŒ
CyberPanel
cyberpanel.net โ€บ blog โ€บ how-to-check-python-version
Quick Ways to Check Python Version on Mac, Windows & Linux
May 17, 2025 - Master how to check Python version on Mac, Linux, & Windows using terminal commands, Python scripts, the `sys` module, & the `py` launcher for a quick check.
๐ŸŒ
Python
python.org โ€บ downloads
Download Python | Python.org
See Status of Python versions for all an overview of all versions, including unsupported.
๐ŸŒ
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 - Learn how to check your Python version in several different operating systems, including Windows, Linux, and macOS.
๐ŸŒ
UltaHost
ultahost.com โ€บ knowledge-base โ€บ check-python-version-linux-windows
How to Check Python Version in Linux & Windows | Ultahost Knowledge Base
November 30, 2024 - This will display the complete version information, including the build number, compiler details, and other relevant information. To exit the Python interpreter, type exit() and press Enter. When checking the Python version, you may encounter some common issues.
๐ŸŒ
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.
๐ŸŒ
Alma Better
almabetter.com โ€บ bytes โ€บ articles โ€บ how-to-check-python-version
How to Check Python Version? (Linux, Windows and Mac)
January 12, 2024 - Learn how to check Python version on Windows, Linux and Mac OS. Explore different types of Python versions and essential commands to check Python versions.
๐ŸŒ
4Geeks
4geeks.com โ€บ how-to โ€บ how-to-check-python-version
How to check python version?
July 16, 2025 - 1import sys 2print(sys.version_info[0]) 3#Output: 3 4print(sys.version_info.releaselevel) 5#Output: final
๐ŸŒ
Reddit
reddit.com โ€บ r/learnpython โ€บ checking the python version on the machine
r/learnpython on Reddit: checking the python version on the machine
March 13, 2023 -

while installing pyton and vscode on my linuxbox i run a test

well i allway thought that the test of python

[martin@martinsendeavour ~]$ which python /usr/bin/python [martin@martinsendeavour ~]$

well i get back this

[martin@martinsendeavour ~]$ which python 

/usr/bin/python [martin@martinsendeavour ~]$

i guess that this is not normal - i have no python on the machine!?

do i