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.

Answer from Oli on askubuntu.com
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.

🌐
Hackers and Slackers
hackersandslackers.com › multiple-python-versions-ubuntu-20-04
Managing Multiple Versions of Python on Ubuntu 20.04
August 20, 2023 - For an introduction into the Python .../+archive/ubuntu/ppa Press [ENTER] to continue or Ctrl-c to cancel adding it. ... To pick up the versions of Python that Deadsnakes makes visible to us, we still need to run a quick update: ... $ apt list | grep python3.10 WARNING: apt does not have a stable CLI interface. Use with caution in scripts. idle-python3.10/focal 3.10.12-1+focal1 all ...
🌐
CyberITHub
cyberithub.com › how-to-check-all-the-python-versions-installed-on-linux
How to Check all the Python Versions Installed on Linux | CyberITHub
January 11, 2023 - If this utility is available in your system then you need to simply run compgen -c python | grep -P '^python\d' command to list out all the versions of python installed in the system. cyberithub@ubuntu:~$ compgen -c python | grep -P '^python\d' ...
🌐
Finxter
blog.finxter.com › check-ubuntu-python-version
Check Ubuntu Python Version – Be on the Right Side of Change
To see all installed Python versions on Ubuntu, you can use the command apt list --installed | grep python. This will display a list of all Python-related packages installed on your system, including different Python versions.
🌐
Softhints
softhints.com › ubuntu-how-to-install-latest-python-and-list-all-python-versions
Ubuntu 18 how to install latest python 3.7 and list all python versions - Softhints
February 1, 2024 - The following article is tested on Ubuntu 18 and Linux Mint 18. The examples are based on Linux Mint. ... If you want to see where and what python versions are installed on your machine you can do it by following commands. Check where python is installed: ... 0 lrwxrwxrwx 1 root root 9 Nov 24 2017 /usr/bin/python -> python2.7 0 lrwxrwxrwx 1 root root 9 Nov 24 2017 /usr/bin/python2 -> python2.7 3412 -rwxr-xr-x 1 root root 3492656 Dec 4 2017 /usr/bin/python2.7 0 lrwxrwxrwx 1 root root 33 Dec 4 2017 /usr/bin/python2.7-config -> x86_64-linux-gnu-python2.7-config 0 lrwxrwxrwx 1 root root 16 Nov 24
🌐
Ubuntu
documentation.ubuntu.com › ubuntu-for-developers › reference › availability › python
Available Python versions - Ubuntu for Developers
June 4, 2025 - Ubuntu Python 3 (deb) packages:,,, Ubuntu version, available Python 3 versions, python3-defaults version,,, 25.10 (Questing Quokka), 3.13, 3.14, 3.13,, 25.04 (Plucky Puffin), 3.13, 3.13,, 24.10 (Or...
Find elsewhere
🌐
Hackers and Slackers
hackersandslackers.com › multiple-versions-python-ubuntu
Managing Multiple Versions of Python on Ubuntu 18.04
August 20, 2023 - $ update-alternatives --list python /usr/bin/python3.6 /usr/local/bin/python3.8 ... You should be hit with a prompt like the one below. This will list all the versions of Python your system recognizes.
🌐
Finxter
blog.finxter.com › how-to-check-your-python-version
Check Python Version: A Simple Illustrated Guide – Be on the Right Side of Change
March 9, 2024 - The shorter command conda list ... the optional flag ‐‐envs to see all your environments. To check your Python version, run python -V or python ‐‐version in your terminal....
🌐
LinuxConfig
linuxconfig.org › home › how to check python version on ubuntu 26.04
How to Check Python Version on Ubuntu 26.04
January 29, 2026 - This command lists all Python-related executables, showing you which versions are available and how the symbolic links are configured. If you need to work with Python 2 for legacy projects, refer to our guide on how to use Python 2 on Ubuntu 26.04.
🌐
Real Python
realpython.com › intro-to-pyenv
Managing Multiple Python Versions With pyenv – Real Python
September 1, 2025 - To see only the available CPython versions starting from 3.10, run the following command: ... $ pyenv install --list | grep -E ' 3\.([1-9][0-9]+)' 3.10.0 3.10-dev 3.10.1 ... 3.13.5 3.13.5t 3.13.6 3.13.6t 3.13.7 3.13.7t 3.14.0rc2 3.14.0rc2t 3.14-dev 3.14t-dev 3.15-dev 3.15t-dev · This output shows all the Python versions that match the specified regular expression.
🌐
How to Use Linux
howtouselinux.com › home › 3 ways to check python version in linux
3 Ways to Check Python Version in Linux - howtouselinux
October 9, 2025 - To check Python version in Linux, you can use python -V command. All you need is to open the terminal then type python -V in the prompt. The Python version will be listed.
🌐
DEV Community
dev.to › hackersandslackers › managing-multiple-versions-of-python-on-ubuntu-4aki
Managing Multiple Versions of Python on Ubuntu - DEV Community
December 6, 2019 - Now we can use update-alternatives --list to list all the alternative installations we have of certain software: $ update-alternatives --list python /usr/bin/python3.6 /usr/local/bin/python3.8 · Now we can swap between versions of Python!
🌐
CyberPanel
cyberpanel.net › blog › how-to-check-python-version
Quick Ways to Check Python Version on Mac, Windows & Linux
September 23, 2025 - In the Command Prompt, type py -0. All installed Python versions will be listed by this command.
🌐
Quora
quora.com › How-do-you-check-if-Python-is-installed-in-Ubuntu
How to check if Python is installed in Ubuntu - Quora
Exit code 0 and a version string = Python 3 installed. ... On modern Ubuntu this may be absent or symlinked to python3; output example: Python 3.11.0 or command not found. ... If empty, no top-level python command in PATH. ... Lists installed Python 3 package(s) provided by APT.
🌐
Medium
medium.com › @akhshyganesh › find-all-python-versions-on-your-system-like-a-pro-2c4d10650035
Find All Python Versions on Your System Like a Pro | by Akhshy Ganesh | Medium
June 12, 2025 - In this quick guide, I’ll walk you through how to track down every sneaky little Python version hiding on your machine. Whether you’re on Windows, macOS, or Linux — we’ve got you covered. Over time, you’ve probably installed Python for different projects. One for data science, one for that Flask API you built last year, and maybe another one by accident when installing VS Code. It’s normal. It’s Pythonic. But you need to know what’s where to avoid chaos. ... This lists all the python.exe files that your system knows about.
🌐
YouTube
youtube.com › watch
How to Check and List All Python Versions Installed on System - YouTube
In this tutorial we will see how to check and find all python versions installed on your windows system
Published   April 3, 2024
🌐
LinuxConfig
linuxconfig.org › home › check python version
Check Python Version: Command & Script Methods
May 3, 2018 - You system may have both Python 2 and Python 3 version installed. List installed python binary executable to see what version is installed on your system: