Python Installation β Windows#
Method 1 β winget (recommended)#
The fastest path. Opens Windows Terminal or PowerShell as a regular user (no admin required in most setups).
winget install Python.Python.3.12
Output:
Found Python 3.12 [Python.Python.3.12] Version 3.12.3
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://www.python.org/ftp/python/3.12.3/python-3.12.3-amd64.exe
Successfully verified installer hash
Starting package install...
Successfully installed
[!TIP] To install the latest 3.13 instead:
winget install Python.Python.3.13
Method 2 β python.org installer#
- Download the installer from python.org/downloads.
- Run the
.exe. - Check βAdd Python to PATHβ on the first screen β this is the most common pitfall.
- Click βInstall Nowβ for defaults, or βCustomizeβ to change the install directory.
[!WARNING] If you forget to check βAdd to PATH,β you can re-run the installer, choose Modify, and check βAdd Python to environment variables.β
Verify the installation#
Close and reopen your terminal after installation so PATH changes take effect.
python --version
pip --version
Output:
Python 3.12.3
pip 24.0 from C:\Users\you\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip (python 3.12)
The py launcher#
Windows installs py.exe β a version switcher that survives PATH problems:
py -3.12 --version # run a specific version
py -3.12 -m pip install requests
py --list # show all installed Python versions
Output:
Python 3.12.3
Installed Pythons found by C:\Windows\py.exe Launcher for Windows
-V:3.12 * C:\Users\you\AppData\Local\Programs\Python\Python312\python.exe
The * marks the default version used when you just run py.
Common pitfalls#
[!WARNING] Microsoft Store Python β Windows may redirect
pythonto the Microsoft Store if no real Python is installed. Runwhere pythonto see what youβre actually launching. If it points toWindowsApps, install via winget or python.org and it will take precedence.
[!WARNING] Multiple Pythons β if you have several versions installed,
pythonmay resolve to an old one. Usepy -3.12or setPYTHONPATHexplicitly. Even better: always work inside a virtual environment (see venv).
[!TIP] After installing, set the default in the py launcher:
setx PY_PYTHON 3.12
Next steps#
# Create a virtual environment
python -m venv .venv
.venv\Scripts\Activate.ps1 # PowerShell
.venv\Scripts\activate.bat # cmd.exe
See Virtual Environments for the full guide.