Installing Python on Windows
Windows does not include a system-supported Python runtime. For a CPython installation maintained by the Python project, use the Python install manager from python.org or the Microsoft Store. The two distributions of the manager provide the same core tool.
Install and verify
- Install the Python install manager.
- Open a new PowerShell or Command Prompt window.
- Launch
python. If no runtime is installed yet, the manager can install the current stable runtime. - Verify the selected runtime and pip:
python --version
python -m pip --version
python -m pip ties pip to the same interpreter as python, which avoids ambiguity when multiple versions are installed.
Manage multiple runtimes
The py command can list and select managed runtimes:
py list
py -V:3.15 --version
Use the version you actually installed; do not copy a version selector blindly. Existing installations from other distributors may also appear, and their management rules can differ.
Create a project environment
Create a separate virtual environment in the project directory:
python -m venv .venv
.venv\Scripts\Activate.ps1
python -m pip --version
In cmd.exe, activate with .venv\Scripts\activate.bat. If PowerShell blocks activation scripts, consult your organization's execution-policy guidance instead of weakening system policy globally. Activation is convenient but not required; .venv\Scripts\python can always address the environment directly.
Add .venv/ to version control ignore rules. Do not install project packages into a shared or system interpreter.
Troubleshooting
- Open a new terminal after installation so command aliases and
PATHchanges are visible. - Use
py listto see which runtime the manager will select. - If
pythonorpyresolves to an older installation, follow the official Windows troubleshooting guidance before removing software or editingPATH. - Prefer virtual environments over administrator-level package installation.