Sign in with Google

How to Install Python on Windows

Tick the PATH box, learn the py launcher, and fix the two errors every Windows beginner hits.

beginner9 min read
dev-setuppythonwindowspowershellbeginners

Installing Python on Windows is a five-minute job with one checkbox that decides whether the next two hours are pleasant or miserable. Miss it and every tutorial command fails with "python is not recognized". There is also a second, stranger failure mode where Windows answers your python command with an advertisement for the Microsoft Store instead of running anything. Both are fixable in under a minute once you know where to look. This guide walks the install, the Windows-only py launcher that makes multiple versions easy, and the virtual environment setup that PowerShell will initially refuse to let you use.
iWhat you need
Windows 10 or 11, about 200 MB of disk space, and 25 minutes. Administrator rights are helpful but not required — the installer can do a per-user install. Open PowerShell by pressing the Windows key and typing "powershell".
Go to python.org/downloads. The page detects Windows and offers the current 3.14 release as a 64-bit executable installer. Download it and run it. The very first screen has two big buttons and, along the bottom, a small checkbox reading Add python.exe to PATH. Tick it before you click anything else.

The install, in order

  1. 1Tick Add python.exe to PATH at the bottom of the first screen. This is the step that matters.
  2. 2Leave Use admin privileges when installing py.exe ticked if you have admin rights — it puts the launcher somewhere every user can reach.
  3. 3Click Install Now. Customize installation is only worth opening if you want a different install directory or need to untick the IDLE and documentation extras.
  4. 4If Windows shows a User Account Control prompt, approve it.
  5. 5On the final screen, click Disable path length limit if it appears. It removes the 260-character path ceiling that breaks some package installs.
  6. 6Close and reopen PowerShell. A running terminal never sees a PATH change made after it started.
If you already missed the checkbox
Do not uninstall anything. Run the same installer again — it now offers Modify, Repair and Uninstall. Choose Modify, click Next past Optional Features, then on the Advanced Options screen tick Add Python to environment variables and click Install. Reopen your terminal afterwards.
Searching the Microsoft Store for Python gives you an official package published by the Python Software Foundation. It installs without admin rights, handles PATH automatically, and updates itself, which makes it a reasonable choice on a locked-down work laptop or a school machine.
The cost is sandboxing. Store apps run under a restricted profile, so writes to the install directory are redirected into a per-user location under %LOCALAPPDATA%\Packages, and the interpreter path is a long generated one rather than something predictable like C:\Python314. Most beginner work is unaffected. Tools that expect a conventional install layout, or anything needing a system-wide install for all users, are where it starts to bite. If you have admin rights, take the python.org installer.
The python.org installer also installs py.exe, a launcher that lives in a fixed location on PATH and dispatches to whichever Python you ask for. There is no equivalent on macOS or Linux, and it is genuinely the best part of the Windows experience — it means having 3.12 and 3.14 installed side by side is a non-event.
Windows
$py --version
Windows
$py --list
The first prints the version of your default interpreter. The second lists every Python the launcher can find, with an asterisk on the default. To target one specifically, name the version: py -3.14 starts 3.14 and py -3.12 script.py runs a script under 3.12. Anywhere a tutorial says python -m, you can say py -m and be more certain about which interpreter you got.
Windows
$python --version
Note that on Windows the command is python, not python3 — that difference trips up people following Mac-written tutorials. To find out which executable is answering, ask the shell. PowerShell and Command Prompt use different commands for this, which is the clearest illustration of why they are not interchangeable.
powershell
PS C:\Users\you> Get-Command python | Select-Object -ExpandProperty Source
C:\Users\you\AppData\Local\Programs\Python\Python314\python.exe

PS C:\Users\you> python --version
Python 3.14.1

REM in Command Prompt instead:
C:\Users\you> where python
C:\Users\you\AppData\Local\Programs\Python\Python314\python.exe

PowerShell uses Get-Command; Command Prompt uses where

PowerShell is the modern shell: it has a real object pipeline, tab completion that works, and a scripting language. Command Prompt is the old cmd.exe, kept for compatibility. They read the same PATH, so a correct install works in both — but their syntax for activating environments and setting variables differs, so always check which one a tutorial assumes.
This is the message that confuses everyone: Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings. It is not a missing install. Windows ships stub executables named python.exe and python3.exe whose only job is to open the Store listing, and if a stub sits earlier in PATH than your real Python, the stub answers first.

Turn the stubs off

  1. 1On Windows 11: open Settings, go to Apps, then Advanced app settings, then App execution aliases.
  2. 2On Windows 10: open Settings, go to Apps, then Apps and features, then App execution aliases.
  3. 3Find the entries named python.exe and python3.exe attached to App Installer and switch both toggles off.
  4. 4Close and reopen your terminal, then run python --version again.
  5. 5If it still fails, your PATH genuinely lacks Python — re-run the installer and choose Modify as described above.
pip ships with Python. Upgrade it once, using the -m form so the upgrade lands in the interpreter you mean rather than whichever pip.exe happens to be first on PATH.
Windows
$py -m pip install --upgrade pip
Then give every project its own virtual environment: a folder containing its own site-packages, so two projects can depend on different versions of the same library without a fight. On Windows the environment's executables live in .venv\Scripts rather than the .venv/bin you see in Mac and Linux tutorials.
powershell
mkdir C:\dev\first-python
cd C:\dev\first-python

py -m venv .venv
.\.venv\Scripts\Activate.ps1

# prompt now reads (.venv) PS C:\dev\first-python>
python -m pip install requests
python -m pip freeze > requirements.txt

deactivate

Creating and using an environment in PowerShell

!The activation error everyone hits
If Activate.ps1 fails with "cannot be loaded because running scripts is disabled on this system", PowerShell's execution policy is blocking it. Fix it for your account only with Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser, then activate again. Do not set it to Unrestricted, and do not run it machine-wide — RemoteSigned still blocks unsigned scripts downloaded from the internet, which is the protection you want to keep.
In Command Prompt the equivalent activation is .venv\Scripts\activate.bat, and no execution policy applies. Either way, add .venv to your .gitignore and commit requirements.txt instead — the environment is rebuildable, so it never belongs in a repository.
Open the project folder in VS Code, press Ctrl+Shift+P, run Python: Select Interpreter, and choose the entry whose path contains .venv. VS Code remembers this per folder and will activate the environment automatically in new integrated terminals. Skipping it is why an installed package sometimes shows a red underline in the editor while running fine in the terminal. How to Set Up VS Code covers the rest of the editor setup.
Plenty of tutorials assume Linux — they use python3, forward slashes, apt install, and source .venv/bin/activate. Windows Subsystem for Linux runs a real Ubuntu on your machine so those commands work verbatim, and VS Code connects into it with the WSL extension.
Windows
$wsl --install
That single command in an administrator terminal installs WSL and Ubuntu, then asks for a reboot. Treat it as a second machine: Python installed in Windows and Python installed in WSL are separate, with separate packages and separate environments. Keep project files inside the Linux filesystem when working there, since crossing between the two is noticeably slower. If you are not following Linux-flavored material, the native install above is enough.

Symptom, cause, fix

  1. 1python is not recognized as an internal or external command. PATH does not include Python. Re-run the installer, choose Modify, and tick Add Python to environment variables.
  2. 2Python was not found; run without arguments to install from the Microsoft Store. An App Execution Alias stub is intercepting the command. Turn off python.exe and python3.exe in Settings.
  3. 3It worked in one window but not another. You changed PATH after opening that terminal. Close it and open a new one.
  4. 4Activate.ps1 cannot be loaded because running scripts is disabled. PowerShell execution policy. Run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser.
  5. 5python3 is not recognized. On Windows the command is python, or py. Only WSL and the Store build give you python3.
  6. 6A package installed but import fails. You installed into a different interpreter. Use py -m pip or the activated environment's python -m pip.
  7. 7pip install fails on a long path during file extraction. The 260-character path limit. Re-run the installer and use Disable path length limit, or move the project closer to the drive root.
  8. 8VS Code shows an unresolved import for a package you installed. The wrong interpreter is selected. Run Python: Select Interpreter and pick the .venv entry.
The terminal is the tool you will lean on hardest from here, so How to Use the Command Line is worth an hour even though its examples lean Unix — everything in it applies inside WSL. Then get version control working with How to Use Git, since requirements.txt only earns its keep once the project is in a repository. If you also work on a Mac, How to Install Python on a Mac covers the differences without repeating the basics. When you would rather follow an ordered path than collect tools, the Programming roadmap sequences the fundamentals so each concept lands on top of the last.