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
🌐
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.
Discussions

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 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
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
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.

🌐
Syncro
syncrosecure.com › home › blog › how to check python version
How to Check Python Version | Syncro
April 25, 2025 - For Windows: Use the “winget” command or check Python via the Apps & Features settings. For Linux: apt list –installed | grep python (for detailed version management, use “dpkg-query -l | grep python”)
🌐
Incorta Community
community.incorta.com › t5 › data-schemas-knowledgebase › how-to-check-the-version-of-a-python-package › ta-p › 4702
How to Check the Version of a Python Package - Incorta Community
July 21, 2023 - Use the __version__ attribute to check the Python package/library, __version__ attribute is recommended by PEP (Python Enhancement Proposals).
🌐
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 - I registered a particular server with Redhat Software Collectiona and installed Python33: # yum install python33 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 ...
Find elsewhere
🌐
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-I-know-if-Python-is-installed-on-Linux
How to know if Python is installed on Linux - 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)
🌐
4Geeks
4geeks.com › how-to › how-to-check-python-version
How to check python version?
July 16, 2025 - 1import platform 2print(platform.python_version()) 3#Output: 3.10.4 · Both options will return the version with a string format. We can obtain this information in the tuple format as well. The return tuple syntax will contain five components: major, minor, micro, release level, and serial: 1import sys 2print (sys.version_info) 3# Output: sys.version_info(major=3, minor=10, micro=4, releaselevel='final', serial=0)
🌐
nixCraft
cyberciti.biz › nixcraft › howto › python › how to find python version on linux or unix
How To Find Python Version on Linux or Unix - nixCraft
March 27, 2023 - To find out which version of Python programming language you have installed on your Linux or Unix-like system, you can use the following command in your Linux/Unix terminal or shell prompt: $ python --version $ python2 --version
🌐
Poetry
python-poetry.org › docs
Introduction | Documentation | Poetry - Python dependency management and packaging made easy
Poetry requires Python 3.10+. It is multi-platform and the goal is to make it work equally well on Linux, macOS and Windows. ... If you are viewing documentation for the development branch, you may wish to install a preview or development version of Poetry.
🌐
GeeksforGeeks
geeksforgeeks.org › python › check-the-version-of-the-python-interpreter
How to check Python Version : Windows, Linux and Mac - GeeksforGeeks
December 17, 2025 - Use the given below commands for checking pyhton 3. ... These commands will display the Python version installed on your Linux system.
🌐
TensorFlow
tensorflow.org › install › pip
Install TensorFlow with pip
Some packages, like tensorflow... versions, but many packages don't. To use those libraries, you will have to use TensorFlow with x86 emulation and Rosetta. Currently there is no official GPU support for running TensorFlow on MacOS. The following instructions are for running on CPU. Check if your Python environment ...
🌐
SuperOps
superops.com › superops blog › blog › how to check the python version?
How to check the Python version in quick and easy steps
18 hours ago - Here are several effective ways ... Terminal by searching “Terminal” in the Spotlight search. In Linux OS, simply press the Ctrl+Alt+T ......
🌐
Linuxize
linuxize.com › home › python › how to check python version
How to Check Python Version | Linuxize
3 weeks ago - To find out which version of Python is installed on your system, run the python3 --version or python3 -V command: ... On some systems, the python command still points to Python 2. Always use python3 explicitly to ensure you are checking the ...
🌐
RoseHosting
rosehosting.com › home › how to check python version on linux
How to Check Python Version on Linux | RoseHosting
June 10, 2024 - Learn how to check what Python version you have on Linux using Command Line or the Python Interpreter using our easy-to-follow guide.
🌐
MiniTool Partition Wizard
partitionwizard.com › home › partition magic › check python version on windows/mac/linux [guide]
Check Python Version on Windows/Mac/Linux [Guide] - MiniTool Partition Wizard
July 19, 2023 - If you want to find what version of Python you are running now, you can check Python version. How to check Python version? MiniTool offers you methods to conduct a Python version check on Windows, Mac, and Linux devices.
🌐
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.
🌐
AbsentData
absentdata.com › home › articles › how to check and update python versions
How to Check and Update Python Versions - AbsentData
December 9, 2023 - Open the terminal window (Press Ctrl+Alt+T on Linux). After opening the terminal window, type python3 –version and press enter to see the current version of Python.
🌐
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.