The quickest way to check your Python version
Open Command Prompt and type python --version, then press Enter. The output will show your Python version number — for example, "Python 3.11.5". This is the most direct method and works on Windows, Mac, and Linux.
If that command does not work, try python3 --version instead. Some systems install Python 3 under the name "python3" to keep it separate from Python 2, which is no longer supported but still exists on older machines.
If neither command produces output, Python is either not installed or not added to your system PATH — the list of locations your computer checks when you type a command. The section below covers what to do in that case.
Key Takeaways
- Type python --version in Command Prompt to see your Python version immediately.
- If that does not work, try python3 --version, since some systems use different names for Python 3.
- You can also type python alone and press Enter to open the Python interpreter, which displays the version at the top.
- If no command works, Python may not be installed or may not be in your system PATH, and you will need to reinstall it or add it manually.
Using the Python interpreter directly
Another way to check your version is to start Python itself. Type python in Command Prompt and press Enter. The interpreter will open and display the version number on the first line, along with build information and the date it was compiled.
Once inside the interpreter, you can also type import sys followed by print(sys.version) to see more detailed version information. Type exit() to close the interpreter and return to the Command Prompt.
This method is useful if you want to verify that Python is working correctly, not just installed. If the interpreter opens without errors, you know the installation is functional.
What to do if the commands do not work
If you type python --version and get an error like "python is not recognized as an internal or external command", Python is either not installed on your computer or not added to your PATH. The PATH is a list of folders where Windows looks for programs when you type a command.
First, check whether Python is actually installed. Go to Control Panel, select Programs, then Programs and Features, and look for Python in the list. If it is there, you need to add it to your PATH. If it is not there, you will need to download and install Python from python.org.
To add Python to your PATH on Windows, open the Python installer, select Modify, check the box that says "Add Python to PATH", and click Install. If Python is already installed, you can repair the installation by going back to Programs and Features, selecting Python, clicking Change, and choosing Repair.
Checking the PATH manually on Windows
If you want to verify that Python is in your PATH without reinstalling, you can view your PATH settings. Right-click This PC or My Computer, select Properties, then click Advanced System Settings. Click Environment Variables at the bottom of the window.
Under System Variables, find the variable named PATH and click Edit. A window will open showing a list of folders separated by semicolons. Look for a folder that contains Python — it usually looks something like C:\Users\YourName\AppData\Local\Programs\Python\Python311 or C:\Python311.
If you see a Python folder in the list, Python is in your PATH and the command should work. If you do not see one, you can add it manually by clicking New and typing the full path to your Python installation folder. You will need to restart Command Prompt after making changes.
Different Python versions on the same computer
Some computers have both Python 2 and Python 3 installed. When you type python --version, you might get Python 2, but you need Python 3. In that case, use python3 --version to check the Python 3 version specifically.
You can also check which version is set as the default by typing python --version and comparing it to python3 --version. If they show different versions, you know which command to use when you need a specific version.
On Windows, you can also use the Python launcher by typing py --version or py -3 --version for Python 3 specifically. The launcher is installed automatically with Python 3.3 and later, and it makes it easier to manage multiple versions.
Why you might need to know your Python version
Different Python versions have different features and syntax. Code written for Python 3.11 might not work on Python 3.8, and Python 2 code will not run on Python 3 without changes. Before you run a script or install a package, checking your version tells you whether your system can handle it.
Many packages and libraries list their Python version requirements in their documentation. If a package requires Python 3.9 or later and you have Python 3.8, you will need to upgrade Python before you can use that package. Knowing your version upfront saves time troubleshooting installation errors.
Frequently Asked Questions
What is the difference between python and python3?
Python 2 reached the end of its life in 2020 and is no longer supported. Python 3 is the current version. Some older systems still have Python 2 installed as "python" and Python 3 as "python3" to keep them separate. On newer systems, "python" usually refers to Python 3.
Can I have multiple Python versions installed at the same time?
Yes. Many developers keep multiple versions installed for testing. Use python --version for the default version and python3.X --version (where X is the minor version number) to check a specific version. The Python launcher on Windows makes this easier.
What if I see "Python 2.7" but I need Python 3?
You need to install Python 3. Download it from python.org and run the installer. Make sure to check "Add Python to PATH" during installation. After installation, use python3 --version to verify Python 3 is installed, or use the Python launcher with py -3 --version.
Does checking the version require administrator access?
No. Checking your version with python --version requires no special permissions. However, installing Python or modifying your PATH may require administrator access, depending on your system settings.