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
🌐
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.! :)

Discussions

How can I check my python version in cmd? - Stack Overflow
I has downloaded python in python.org, and I wanted to check my python version, so I wrote python --version in cmd, but it said just Python, without version. Is there any other way to find out pyt... More on stackoverflow.com
🌐 stackoverflow.com
How do I check which version of Python is running my script? - Stack Overflow
How do I check which version of the Python interpreter is running my script? See Find full path of the Python interpreter (Python executable)? if you are looking to find exactly which interpreter... More on stackoverflow.com
🌐 stackoverflow.com
Python --version command isn't working on windows
giving the command python --version gives the following error Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. I think when I first installed python 5 or 6 years ago, I didn’t install it ... More on discuss.python.org
🌐 discuss.python.org
6
0
December 30, 2023
The correct Python version is not showing up in Terminal.
How did you install the newer python version? I see you have anaconda installed so did you create a new environment with conda? (This would be basically: conda create -n myenv python=3.12 conda activate myenv ) If you use conda for virtual environments and managing versions and dependencies it's not a good idea to mix that with other installations from other sources. You likely have the other version installed somewhere but it's not your terminals default Interpreter/installation. See for more detail: https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html More on reddit.com
🌐 r/learnpython
17
2
November 24, 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 --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 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
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
🌐
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.
🌐
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.
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.

Find elsewhere
🌐
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 - In Linux OS, simply press the Ctrl+Alt+T keys to launch the terminal window. Type the following commands and press Enter: “python --version” or “python -V”
🌐
Python
python.org › downloads
Download Python | Python.org
Guido remains Python’s principal author, although it includes many contributions from others. ... See Status of Python versions for all an overview of all versions, including unsupported.
🌐
GeeksforGeeks
geeksforgeeks.org › python › check-the-version-of-the-python-interpreter
How to check Python Version : Windows, Linux and Mac - GeeksforGeeks
December 17, 2025 - To check the Python version on Windows or a Mac system, we can follow these methods: ... Open the Command Prompt for Windows by searching for "cmd" in the Windows Start menu, or open Terminal for Mac by searching "terminal" in the macOS spotlight search.
🌐
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 checking ... 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....
🌐
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 - The simplest option is to use the __version__attribute to check. However, this option will only work if the package has been installed under a specific version number. Use the __version__ attribute to check the Python package/library, __version__ attribute is recommended by PEP (Python Enhancement ...
🌐
Alma Better
almabetter.com › bytes › articles › how-to-check-python-version
How to Check Python Version? (Linux, Windows and Mac)
January 12, 2024 - The terminal will display the installed Python version. Please note that in some cases, the command may return a screen full of information. In such cases, scan through the output to locate the word "python" followed by a version number, which represents the installed Python version. It is possible to have multiple versions of Python installed on the same system. Python 2.7.x and Python 3.7.x can coexist, but they are different programs. To check for Python 2.7.x, use the following command:
🌐
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)
🌐
Python
docs.python.org › 3 › using › windows.html
4. Using Python on Windows — Python 3.14.4 documentation
This version may change over time as you add or remove different versions, and the py list command will show which is current. In general, we recommend that you create a virtual environment for each project and run <env>\Scripts\Activate in ...
🌐
TestMu AI Community
community.testmuai.com › ask a question
How to Check Python Module Versions from the Command Line? - Ask a Question - TestMu AI Community
December 3, 2024 - How do I check the versions of Python modules? I installed the Python modules construct and statlib using setuptools: sudo apt-get install python-setuptools sudo easy_install statlib sudo easy_install construct How do…