How to Install Python on Windows

Learn how to download, install, configure, and verify Python, pip, the Python launcher, and IDLE on Windows.

Python must be installed before you can run Python programs locally on a Windows computer. A standard Python 3 installation provides the Python interpreter, command-line tools, the Python launcher, package-management tooling, and usually IDLE.

The Python interpreter is the program that reads and runs Python code. Python 3 is the current major generation used for modern Python programming. Installing Python itself is separate from installing third-party libraries later. The installer normally includes pip, Python's package installer, but packages such as web frameworks or data-science libraries are installed afterward for individual projects.

Choose the Official Python Distribution

Download Python from the official Python downloads page. Select a current stable Python 3 release for Windows rather than an experimental, obsolete, or unofficial build.

For most modern computers, choose the standard Windows executable installer for 64-bit Windows. The correct architecture depends on your Windows installation and computer. Most current Windows computers use 64-bit Windows, but check your system information if you are unsure.

  • Windows executable installer: the normal setup program for beginners.
  • Source archive: Python's source code for people who need to build Python themselves; it is not the usual beginner choice.
  • Embeddable package: a minimal distribution intended for embedding Python in another application; it is not the normal choice for learning Python or using command-line tools.

Download the Windows Installer

  1. Open a web browser and go to the official Python downloads page.
  2. Choose the current stable Python 3 release for Windows.
  3. Download the Windows executable installer with the architecture appropriate for your computer, typically 64-bit.
  4. Wait for the download to finish.

Browsers commonly save downloaded files in the Downloads folder. You can usually locate the installer by opening your browser's download list or by opening File Explorer and selecting Downloads. The file normally has an executable installer name and an .exe extension.

Run the Python Installer

Open the downloaded installer. Windows may display a security prompt asking whether you want to allow the program to make changes. Confirm the publisher and choose the option to continue only if you intentionally downloaded the installer from the official Python source.

The first setup screen normally offers an immediate default installation and a way to customize installation options. Before starting, pay close attention to the option labeled Add Python to PATH.

Add Python to PATH

The PATH environment variable is a Windows setting containing folders where executable commands can be found. When Python's installation folder is added to PATH, a new Command Prompt or PowerShell window can find commands such as python and, when configured, pip without requiring the full installation path.

Select Add Python to PATH before installing if you want to use the python command easily from terminals. The Python launcher command, py, is also useful on Windows and can often work even when the python command is not on PATH.

If you miss this option, you can modify the Python installation later or add the relevant Python and Scripts folders to PATH manually. Modifying the installation is generally safer for beginners than guessing which folders to add.

Install Now or Customize

Install Now uses suitable default settings and is appropriate for most beginners. Choose Customize installation when you need to select optional features, choose a different installation directory, or make an all-users installation.

Installer optionPurposeRecommended choiceWhen to change it
Add Python to PATHMakes Python commands available from newly opened terminals.Select it.Only leave it unselected if you intentionally manage PATH another way.
Install Now versus Customize installationUses defaults immediately or lets you choose components and locations.Install Now for most beginners.Customize for special locations, features, or account-wide installation.
Current user versus all usersLimits Python to your Windows account or makes it available to multiple accounts.Current user when you do not need administrator access.Choose all users when required by an organization or shared computer and authorized administrator access is available.
pipInstalls Python's package-management tool.Retain it.Omit it only for a specialized installation.
Python launcherProvides the Windows py command for finding and selecting Python versions.Retain it.Change it only when managing Python through another approved method.
IDLEProvides a basic editor and interactive Python environment.Retain it while learning.Omit it if you have a deliberate alternative and do not need it.
Tcl/Tk and tkinterSupports IDLE and Python programs using the Tk graphical interface.Retain it.Change it for a specialized minimal installation.
DocumentationInstalls local Python documentation.Optional; retaining it is useful.Omit it to save disk space if online documentation is available.
Debugging symbols and binariesSupports specialized debugging and development work.Usually omit for beginner programming.Install when a debugger, extension developer, or support instruction requires them.
Disable path-length limitRemoves a Windows path-length restriction when the installer offers this action.Enable it when available and permitted.Leave it unchanged when organizational policy prevents it.

Choose an Installation Directory

The installation directory is the folder where Python's executable files, standard library, and supporting files are placed. The default location is suitable for most learners. Choose a custom directory only when an organization requires it, your system has limited space on the default drive, or you have a clear reason to manage the location yourself.

A current-user installation is available only to the signed-in Windows account and often avoids an administrator prompt. An all-users installation is available to multiple Windows accounts and generally requires elevated administrator permission. On a managed computer, organizational policies may prevent either the installation or the selected location.

Complete the Installation

  1. Review the selected features and installation location.
  2. Start the installation and wait while setup copies the files.
  3. Approve an administrator prompt if your chosen installation requires it and you have authorization.
  4. When setup reports success, close the installer.
  5. If the installer offers to remove the Windows path-length limit, enable that option when available and permitted. Long project and package paths can otherwise cause development or installation errors.
  6. Close any Command Prompt or PowerShell windows that were already open, then open a new terminal. Environment-variable changes are normally detected only by newly opened processes.

Verify Python from Command Prompt or PowerShell

Command Prompt and PowerShell are Windows command-line shells. Open either one from the Start menu after installation. Run the commands below one at a time.

CommandWhat it checks or doesExpected result
py --versionDisplays the default version selected by the Python launcher.A Python 3 version number, such as Python 3.x.y.
python --versionDisplays the version reached through PATH.A Python version when the python command is configured.
pyStarts the interactive interpreter.A version banner followed by a >>> prompt.
py -m pip --versionChecks pip for the interpreter selected by py.A pip version and a location associated with that Python installation.
py --listLists Python versions discovered by the launcher.A list of installed Python versions.
py -3.x --versionChecks a particular installed Python 3 minor version; replace x with the version you have.The requested version number.
py hello.pyRuns a saved script named hello.py.The output produced by the script.

A successful interactive session resembles this:

py
>>> print("Hello, Python!")
Hello, Python!
>>> exit()

The exit() command leaves the interactive interpreter. You can also use the platform-appropriate end-of-file shortcut. On Windows terminals, this is commonly Ctrl+Z followed by Enter.

Use IDLE for a First Test

IDLE is a basic integrated development environment included with many Python installations. It provides an editor and an IDLE Shell, which is an interactive Python environment.

  1. Open the Start menu.
  2. Search for IDLE and open the entry associated with the installed Python version.
  3. In the IDLE Shell, enter print("Hello, Python!") and press Enter.
  4. Confirm that the shell displays Hello, Python!.

Entering one command at a time in the shell is useful for quick experiments. A saved Python program is a text file ending in .py. For example, create hello.py with this content:

print("Hello, Python!")

Open a terminal in the folder containing the file and run py hello.py. A script can be saved, edited, and run repeatedly, unlike a command entered only in an interactive session.

Install and Select Multiple Python Versions

Windows can have more than one Python version installed. The Python launcher is the preferred Windows tool for listing and selecting them because it reduces ambiguity about which interpreter runs a command.

py --list
py -3.12 --version
py -3.12 -m pip --version

Replace 3.12 with an installed version. Use the same version selector for package operations:

py -3.12 -m pip install package_name

Do not assume that python always refers to the installation you intend. PATH order, Windows aliases, and multiple installations can make the result different from the launcher's default. The form py -m pip, or py -3.x -m pip for a specific version, helps ensure that pip belongs to the interpreter you selected.

Common Windows Python Problems

SymptomLikely causeResolution
python is not recognized.Python was not added to PATH, the terminal is old, or PATH points to a missing location.Close and reopen the terminal, test py --version, and use the launcher if available. Modify the installation to add Python to PATH, or carefully add the Python and Scripts directories to PATH.
The Microsoft Store opens instead of Python.A Windows app execution alias for python.exe or python3.exe is intercepting the command.Use py immediately. In Windows settings, review App Execution Aliases and disable conflicting Python aliases. Ensure the installed Python directory is on PATH if you want to use python.
pip is not recognized.The Scripts directory is not on PATH or pip was omitted.Use py -m pip. Modify or repair the installation to include pip when necessary.
pip installs for the wrong Python.Several Python installations exist and the standalone pip command resolves to another one.Use py -m pip, or select a version explicitly with py -3.x -m pip.
The wrong Python version runs.PATH order selects an unexpected version, or the launcher default differs from the desired version.Run py --list, then use py -3.x explicitly. Review PATH or launcher configuration only when a persistent default change is needed.
Installation requires administrator access.The selected location or all-users installation requires elevated permissions, or device policies restrict installation.Choose a current-user installation when appropriate, use authorized administrator access for all users, or contact the device administrator.
The terminal cannot find Python immediately after installation.The terminal session started before environment variables changed.Close that window and open a new Command Prompt or PowerShell session.

Post-Installation Next Steps

  • Learn how to create and run a Python script from a terminal, such as py hello.py.
  • Learn basic Python syntax, including variables, strings, numbers, conditions, loops, and functions.
  • Before installing project-specific third-party packages, create a virtual environment. A virtual environment is an isolated Python environment for one project and its dependencies.
  • When you need a package, prefer py -m pip install package_name so pip is associated with the intended interpreter.

After these checks, your Windows computer is ready for Python programming with the interpreter, launcher, pip, and—when selected—IDLE available for learning and development.