Python online course

How to Install Python on Windows

Install the latest stable Python 3 release on Windows, configure PATH, verify Python and pip, and learn essential next steps.

Python must be installed before you can run Python programs locally on a Windows computer. This guide installs a current stable Python 3 release and verifies that the interpreter and included tools work from the command line.

What the installation provides

The Python interpreter is the program that executes Python code. A Windows installation normally provides the interpreter, the Python Launcher or command-line commands, the standard library, and pip. pip is Python's package installer for adding third-party libraries.

Depending on the selected components, the installation can also include documentation, the IDLE editor and interactive shell, Tcl/Tk support, the Python test suite, and the Python Launcher. Python 3 is the modern major version that new learners should install; do not choose an obsolete Python 2 release.

Before you begin

  • Know how to open a browser download, File Explorer, and the Start menu.
  • Be able to open Command Prompt, PowerShell, or Windows Terminal.
  • Know whether you can approve a Windows administrator prompt if one appears.

Download Python safely

Use the official Python downloads page for Windows. Choose a current stable Python 3 release and download the Windows installer that matches your computer's architecture. For most modern Windows computers, this is the 64-bit executable installer.

  • Choose the 64-bit installer for a typical 64-bit Intel or AMD Windows system.
  • Choose the 32-bit installer when Windows itself is 32-bit and a matching build is available.
  • Choose an ARM64 installer for an ARM-based Windows computer when available.

Avoid installers from untrusted third-party download sites. The installer should come from the official Python website so that its source and release can be checked.

Installer choiceRecommended useNotes
64-bit executable installerMost modern Windows computersUse for 64-bit Intel or AMD systems.
32-bit executable installer32-bit Windows systemsMatch the installer to Windows, not merely to the processor.
ARM64 installerARM-based Windows computersUse when an ARM64 build is available for the release.
Current-user installationPersonal use without administrator accessInstalls for the selected Windows user.
All-users installationShared computersCan require administrator privileges and installs for multiple users.
Install nowTypical beginner installationUses a simple path through the installer with standard choices.
Customize installationSpecific locations, components, or policiesUseful when managing disk layout or multiple Python installations.

Start the Windows installer

Open the downloaded executable from your browser's downloads list or from File Explorer. Windows may display a User Account Control (UAC) prompt. UAC is a Windows permission prompt that appears when software requests system-level changes; approve it only when you intended to start the official installer.

The first installer screen usually offers a quick installation and a customization path. Before beginning, enable the option that adds Python to the PATH environment variable. PATH is a Windows setting that lets a terminal find commands such as python without requiring the full installation path.

Choose installation scope and location

Current user or all users

A current-user installation is normally the easiest choice for a beginner installing Python for personal use. It usually does not require administrator credentials and is available to that Windows account.

An all-users installation is appropriate when several accounts on a shared computer need the same installation. It commonly requires administrator approval and uses a system-wide location. On a managed computer, follow the organization's software-installation policy.

Default or custom location

Accept the default installation location unless you have a specific reason to change it. A custom location can be useful for organizational requirements, a different disk layout, or deliberately managing multiple Python installations. Choose a custom path carefully and record it so that you can identify the installation later.

Select Python components

The customization screens can list several components:

  • Python interpreter: Executes Python programs.
  • pip: Installs and manages third-party packages. Retain it for normal Python development.
  • Documentation: Installs local Python documentation.
  • IDLE and Tcl/Tk: Provides the lightweight IDLE editor and shell.
  • Python test suite: Installs tests used to check Python itself; most beginners do not need to run them.
  • Python Launcher: Commonly invoked with py; helps select an installed Python version when several versions coexist.

For most beginners, retain the default component selection, especially the interpreter, pip, and launcher. Choose Customize installation when you need to inspect or change these options.

Complete the installation

Continue through the installer and wait for it to finish. Close the installer after it reports success.

Some installers offer an option to remove the Windows path-length limitation. Enabling it is generally beneficial because development tools and packages can create long directory paths. Windows may request administrator approval for this change.

A restart is usually unnecessary. However, close and reopen any terminal that was already open before installation. Existing terminals may not know about changes made to PATH.

Verify Python from a new terminal

Open a new Command Prompt, PowerShell window, or Windows Terminal. The py command uses the Python Launcher, while python works when the interpreter was added to PATH and no other command is intercepting it.

Check the installed version

py --version
python --version

Successful output displays a Python 3 version. The exact version number depends on the current stable release you installed.

Check the launcher and pip

py --version
py -m pip --version

The pip output should include a version and a path associated with the Python installation selected by the launcher. Using py -m pip is safer than using a standalone pip command when multiple Python versions are installed.

Run an expression interactively

An interactive shell is a prompt where Python expressions and statements execute immediately. Start it with:

py

At the prompt, enter a simple expression:

print("Python is working")
2 + 3

You should see the message and the result 5. Exit the interpreter with:

exit()
GoalCommandSuccessful result
Check Python versionpy --versionDisplays an installed Python 3 version.
Check launcher versionpy --versionConfirms that the Python Launcher can find Python.
Check pip versionpy -m pip --versionDisplays pip's version and its associated installation path.
Start interactive PythonpyShows a Python prompt such as >>>.
Exit interactive Pythonexit()Returns to the Windows terminal.

Use IDLE as an optional first environment

If IDLE was installed, open it from the Windows Start menu by searching for IDLE and selecting the entry for your Python version. Its shell window lets you run expressions immediately, and its editor can be used for short scripts.

IDLE is optional and is not the only way to write Python. You can also run Python from a terminal, use another code editor, or choose an integrated development environment later. See using the IDLE editor for more practice.

Basic post-installation guidance

Use a virtual environment for projects

A virtual environment is an isolated Python environment containing a project's interpreter context and dependencies. Separate environments prevent packages for one project from interfering with another.

mkdir my-project
cd my-project
py -m venv .venv

Activate it in Command Prompt with:

.venv\Scripts\activate

Activate it in PowerShell with:

.venv\Scripts\Activate.ps1

Install packages with the pip belonging to the intended interpreter, preferably by using the launcher or the active environment:

py -m pip install package-name

Manage multiple Python versions

Multiple Python versions can coexist on Windows. The Python Launcher can request a particular installed version:

py -3.12 --version

Version-specific launcher commands avoid relying on whichever python executable appears first on PATH. This is especially useful when a project requires a particular minor version.

Troubleshoot common problems

python is not recognized

  • Close and reopen the terminal.
  • Try py --version to use the launcher.
  • Rerun or modify the installer and enable the option to add Python to PATH.
  • If python opens the Microsoft Store, review Windows app execution aliases and disable an alias that is intercepting the command, if appropriate.

py is not recognized

The Python Launcher may not have been selected, or the installation may not have completed. Modify or rerun the installer and select the launcher feature. If necessary, use the installer's repair or reinstall process.

pip is unavailable or uses the wrong version

pip may not have been selected, or another Python installation may be earlier on PATH. Use:

py -m pip --version

Repair or modify the installation if pip is missing. If several versions exist, use a version-specific launcher command to target the intended interpreter.

Installation requires permission

An all-users installation or a system-level option can require administrator rights. Choose a current-user installation when it meets your needs, request approved administrator credentials, or follow the computer's organizational policy.

A different or older Python version opens

Another installation may appear earlier on PATH. Use the Python Launcher and a version selector, such as py -3.12, to choose deliberately. Change PATH only when you need to establish a persistent default command.

Packages fail because of long paths

Enable the installer's long-path option when it is offered and permitted. You can also use a short project directory path and follow local administrator and security policies.

PowerShell blocks virtual-environment activation

PowerShell execution policy may prevent local activation scripts from running. Use Command Prompt activation as an alternative, or ask an administrator about an approved execution-policy setting. Any policy change should follow organizational security requirements.

Next steps

After verification, continue with running Python code, the interactive prompt, or writing your first program. When you are ready to install libraries, learn more about Python and use project virtual environments from the beginning.