skip to content

Python Installation β€” Windows

Install Python 3 on Windows via winget or the python.org installer. Covers PATH setup, the py launcher, and verification steps.

2 min read 7 snippets yesterday quick read

Python Installation β€” Windows#

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#

  1. Download the installer from python.org/downloads.
  2. Run the .exe.
  3. Check β€œAdd Python to PATH” on the first screen β€” this is the most common pitfall.
  4. 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 python to the Microsoft Store if no real Python is installed. Run where python to see what you’re actually launching. If it points to WindowsApps, install via winget or python.org and it will take precedence.

[!WARNING] Multiple Pythons β€” if you have several versions installed, python may resolve to an old one. Use py -3.12 or set PYTHONPATH explicitly. 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.