Windows Python advice ages unusually fast. The old screenshot-driven routine—download one python-3.x-amd64.exe, tick Add to PATH, and hope the right interpreter wins—now collides with Store aliases, legacy launchers, multiple runtimes, and project tooling. For supported Windows versions, Python’s current recommendation is the Python Install Manager.
Choose the installation route
Microsoft Store: Python’s recommended route for most users; installs the same manager distributed through python.org.
python.org MSIX: useful when the Store UI is unavailable but MSIX packages are permitted.
WinGet: repeatable command-line installation for supported Windows clients.
Traditional executable installer: still available for current releases but being phased out; Python says it will stop with Python 3.16.
Enterprise/offline deployment: use the manager’s documented MSIX/MSI/offline-index options with administrator policy rather than copying a consumer setup blindly.
Install the Python Manager with WinGet
winget install 9NQ7512CXL7T -e --accept-package-agreementsWhat this command does
winget installasks Windows Package Manager to install the exact Store product selected by-e.9NQ7512CXL7Tis the official Store product identifier documented by Python.--accept-package-agreementsaccepts the package terms; review organizational policy before scripted deployment.Close and reopen the terminal after installation so command aliases and PATH changes are visible.
Install and select Python runtimes
py list --online
py install 3.14
py listHow runtime management works
py list --onlineshows runtime tags currently offered by the manager; do not hard-code the “latest” patch version into evergreen documentation.py install 3.14requests the latest available runtime matching that feature-series tag. Choose the version your project supports.py listshows installed runtimes and which one is the default.The manager and runtimes have separate lifecycles: removing the manager does not automatically remove managed runtimes.
Verify which executable actually runs
python --version
py list
where.exe python
python -c "import sys; print(sys.executable); print(sys.version)"Read all four checks together
python --versionproves the command launches, but not which file supplied it.where.exe pythonlists matching executables in search order and exposes stale PATH entries or Store aliases.sys.executableis the interpreter path from inside the running process—the strongest identity check.sys.versionincludes build/compiler details useful in bug reports. Do not assumepythonandpyselect the same runtime until verified.
Create one virtual environment per project
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pipWhy this is the professional default
python -m venv .venvcreates an isolated interpreter environment using the selected runtime.PowerShell activation prepends the environment’s executable and Scripts directory for the current shell session; it does not globally replace Python.
python -m pipbinds pip to the verified interpreter and avoids installing through an unrelatedpip.exe.Keep
.venvout of source control and reproduce dependencies from a lock/requirements file. If policy blocks activation scripts, invoke.venv\Scripts\python.exedirectly rather than weakening machine-wide execution policy.
Confirm package installation isolation
python -m pip --version
python -c "import sys; print(sys.prefix); print(sys.base_prefix)"What the output proves
pip --versionprints both pip’s version and installation path; that path should belong to.venv.Inside a virtual environment,
sys.prefixidentifies the environment whilesys.base_prefixidentifies the base runtime.Different values confirm venv isolation; equal values usually mean the environment is not active.
Packages still execute native code with your user permissions—install only trusted names and versions.
Fix “python opens the Microsoft Store” or command conflicts
Open Start → Manage app execution aliases and confirm the Python Manager aliases are enabled and consistently assigned. Toggle off stale App Installer aliases when they intercept a separately managed runtime.
Ensure
%UserProfile%\AppData\Local\Microsoft\WindowsAppsremains in the user PATH for manager aliases.If
pyreports that it cannot open a file, an older Python Launcher may have priority; remove “Python launcher” from Installed apps after confirming it is the conflict.Use
where.exe pythonandwhere.exe pyafter every change; guessing at PATH produces fragile systems.Open a new terminal because existing processes retain their original environment.
Administrator rights and system-wide installs
The manager is designed primarily for per-user runtime management and often avoids administrator access. Shared laboratory, CI, classroom, and enterprise installations need deliberate ownership, update, ACL, PATH, and package-cache policy. Python documents py install --target=<shared location> as an advanced building block, not a substitute for endpoint management.
Uninstall without leaving a confusing machine
py uninstall --purgeRisk level: caution. Review the command before running it.
Understand the scope before confirming
py uninstall --purgeperforms the manager’s full runtime cleanup and is destructive to managed Python installations.Back up project code and dependency specifications first; virtual environments are reproducible and should not be treated as source backups.
Uninstalling only the Python Install Manager through Installed apps does not remove installed runtimes.
After removal, inspect Installed apps,
where.exe python, aliases, PATH entries, and project.venvdirectories separately.
Troubleshooting checklist
`python` is not found: reopen the terminal, verify execution aliases and WindowsApps PATH, then run the manager configuration checker.
`py` invokes an old launcher: inspect
where.exe pyand remove the legacy launcher conflict.pip installs to the wrong location: use
python -m pipafter verifyingsys.executableand activating the project environment.Activation is blocked: call
.venv\Scripts\python.exedirectly; do not broadly disable PowerShell security controls.32-bit/ARM64 mismatch: choose a runtime matching Windows architecture and native dependencies.
A package cannot build: update pip/build tools inside the venv, read the package’s supported Python matrix, and prefer an official wheel when available.
Multiple versions disagree: use
py list, explicit runtime tags, and per-project virtual environments instead of reordering PATH repeatedly.
Related development guides
After installation, use GDB for native C debugging on Ubuntu when Python extensions cross into native code.
Store your first project safely with Create a GitHub Repository.
Validate project configuration with the JSON formatter and validator.
Primary references
Python’s current Using Python on Windows guide documents the Install Manager, aliases, runtimes, venvs, troubleshooting, offline deployment, and uninstall behavior.
The official Python releases for Windows page lists current supported releases and manager downloads.
Microsoft explains Python development on Windows, including App Execution Alias behavior.
Comments and corrections