Checking for Python in the Command Prompt
The first way to check for a Python installation is through the Windows Command Prompt. This is a quick and easy method.
Using python --version
-
Open the Command Prompt: Press the Windows key, type
cmd
, and press Enter. -
Type the following command and press Enter:
python --version
If Python is installed and configured correctly, this will display the Python version number (e.g.,
Python 3.11.4
).
Using py --version
Sometimes, especially on newer Windows systems, the python
command might not work directly. The py
launcher is a more reliable way to check.
-
In the same Command Prompt window, type:
py --version
This command uses the Python launcher to find and display the default Python version.
Checking for Python in Windows Settings
If the command prompt doesn't show a Python installation, or you want to confirm, you can check in the Windows Settings.
-
Open Settings: Press the Windows key + I.
-
Navigate to "Apps" then "Apps & features".
-
In the list of installed apps, look for "Python".
- If you find "Python", it's installed. The version number will usually be displayed alongside the name (e.g., "Python 3.9 (64-bit)").
- You might see multiple entries for Python (e.g., "Python 3.8", "Python 2.7"). This indicates you have multiple versions installed.
Understanding Python 2 and Python 3
If you find both Python 2 and Python 3 installed, it's important to understand the difference.
- Python 2: An older version of Python that is no longer officially supported. New projects should not use Python 2.
- Python 3: The current and actively maintained version of Python. All new development should be done with Python 3.
When using the command prompt, python
might default to Python 2 if it's installed. Using py
is generally recommended as it allows you to specify which version you want to use. You can also explicitly call Python 3 using python3 --version
if it's available.
Important Note: Python 2 reached its end-of-life on January 1, 2020. You should migrate any existing Python 2 code to Python 3.
For more information on the differences between Python 2 and 3, refer to the official Python documentation: https://docs.python.org/3/howto/python2.html
You can also find helpful information about the Python launcher for Windows here: https://docs.python.org/3/using/windows.html#the-py-launcher
Expected Outcome for this step:
User will be able to verify if Python is installed on their Windows system and identify the version(s) present.
No comments on this specific step yet. Be the first!
(Form to add comment for this step coming soon)