How to Check Python Version in Linux, Windows, And macOS?
To check the Python version on different operating systems, you can follow these steps:
Open Terminal: You can usually open it by pressing
Ctrl + Alt + T or by searching for ‘Terminal’ in your applications menu.
Type the Command: Enter
python --version or
python3 --version in the terminal and press Enter. If both Python 2 and Python 3 are installed, these two commands will show you the respective versions.
Open Command Prompt: Press
Win + R, type
cmd, and press Enter.
Type the Command: In the Command Prompt, type
python --version and press Enter. This will display the installed Python version.
Open Terminal: You can find the Terminal in the Utilities folder of your Applications folder, or use Spotlight to search for it.
Type the Command: Similar to Linux, type
python --version or
python3 --version in the Terminal and press Enter to see the installed version of Python.
If Python is not installed or not added to the PATH, these commands may return an error or no response.
On some systems,
python might refer to Python 2.x, while
python3 specifically refers to Python 3.x.
If you have multiple versions of Python installed and want to check a specific version, you might need to specify the exact path to the Python executable.
This article incorporates information and material from various online sources. We acknowledge and appreciate the work of all original authors, publishers, and websites. While every effort has been made to appropriately credit the source material, any unintentional oversight or omission does not constitute a copyright infringement. All trademarks, logos, and images mentioned are the property of their respective owners. If you believe that any content used in this article infringes upon your copyright, please contact us immediately for review and prompt action.
This article is intended for informational and educational purposes only and does not infringe on the rights of the copyright owners. If any copyrighted material has been used without proper credit or in violation of copyright laws, it is unintentional and we will rectify it promptly upon notification. Please note that the republishing, redistribution, or reproduction of part or all of the contents in any form is prohibited without express written permission from the author and website owner. For permissions or further inquiries, please contact us.