1. Installing Python on Windows
1. Introduction
Windows does not come with Python preinstalled.
To start programming, we must download, install, and configure the latest version of Python.
2. Downloading Python
- Open a web browser.
- Go to the official Python download page:
https://www.python.org/downloads/windows/ - The site will automatically suggest the latest stable version (for example: Python 3.12.x).
- Click the Download Python 3.x.x button.
3. Running the Installer
- Locate the downloaded file in your Downloads folder (example:
python-3.12.x-amd64.exe). - Double-click the installer to run it.
- On the first screen:
- ✅ Check the box “Add Python to PATH” (very important).
- Click Install Now.
- Wait for the installation to complete.
4. Custom Installation (Optional)
If you want more control:
- Choose Customize installation.
- Options you may enable:
- Documentation
- pip (package manager)
- Add Python to environment variables
- This is useful if you want multiple versions of Python installed.
5. Verifying Installation
- Open the Command Prompt (press
Win + R, typecmd, press Enter). - Type:
python --version
or
py --version
You should see something like:
Python 3.12.2
- Verify pip:
pip --version
6. First Run of Python
In Command Prompt, type:
python
This opens the Python REPL (interactive shell).
Type exit() or press Ctrl + Z then Enter to quit.
7. Troubleshooting
-
‘python’ not recognized:
- Try
pyinstead. - If that works, it means Python is installed but not added to PATH.
- Reinstall and check the “Add to PATH” option.
- Try
-
Multiple versions of Python:
- Use
py -0to list installed versions. - Run a specific version with
py -3.12orpy -3.11.
- Use
-
Pip missing:
- Run the installer again and check pip option.
8. Uninstalling Python
- Open Control Panel → Programs → Programs and Features.
- Find Python in the list.
- Select it and click Uninstall.
9. Next Steps
✅ Python is now installed on Windows.
In the next chapter, we will learn how to install Python on macOS.