> ## Documentation Index
> Fetch the complete documentation index at: https://fastapi2day.codewithsiva.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Installing Python on Windows 10 and 11: Full Guide

> Step-by-step guide to installing Python on Windows, setting up PATH, verifying your installation, and fixing the most common Windows-specific issues.

Installing Python on Windows is straightforward, but there is one critical checkbox during setup that trips up a large number of beginners. Follow the steps below carefully and you will have a working Python installation in under five minutes. This guide covers Windows 10 and Windows 11 — the steps are identical for both.

<Steps>
  <Step title="Download the installer">
    Go to [python.org/downloads](https://www.python.org/downloads/). The website automatically detects that you are on Windows and presents a button for the latest stable release. Click it to download the `.exe` installer to your Downloads folder.

    <Tip>
      Always download Python from the official website. Avoid third-party mirrors or the Microsoft Store version, which has limitations for development use.
    </Tip>
  </Step>

  <Step title="Run the installer and check 'Add to PATH'">
    Open the downloaded `.exe` file. Before you click anything else, look at the bottom of the first installer screen — you will see a checkbox labelled **"Add python.exe to PATH"**.

    **Check that box.** It is unchecked by default.

    <Warning>
      If you skip "Add python.exe to PATH", the `python` command will not be recognised in any terminal window. This is the single most common Windows installation mistake. If you forget, the Troubleshooting section below shows you how to fix it.
    </Warning>

    Once the box is checked, click **"Install Now"** (not "Customize installation" unless you have a specific reason to change defaults).
  </Step>

  <Step title="Approve the UAC prompt">
    Windows will ask: *"Do you want to allow this app to make changes to your device?"* Click **Yes**. This grants the installer the permissions it needs to write to `Program Files` and update your system PATH.
  </Step>

  <Step title="Wait for installation to complete">
    The installer typically finishes in one to two minutes. When you see the **"Setup was successful"** screen, click **Close**.
  </Step>

  <Step title="Open Windows Terminal">
    Press **Windows + R**, type `wt`, and press Enter. Alternatively, search for **Terminal** in the Start menu and open it.

    <Note>
      Windows Terminal is the modern shell host for Windows. It can run PowerShell, Command Prompt, or other shells. If you don't have it, search for **Command Prompt** or **PowerShell** instead — the Python commands below work in all three.
    </Note>
  </Step>

  <Step title="Verify your installation">
    In the terminal, run:

    ```bash theme={null}
    python --version
    ```

    You should see the version number you just installed, for example:

    ```text theme={null}
    Python 3.13.5
    ```

    Also verify that `pip` (the package manager) is available:

    ```bash theme={null}
    pip --version
    ```
  </Step>

  <Step title="Test the Python interpreter">
    Launch the Python REPL (interactive interpreter) by typing:

    ```bash theme={null}
    python
    ```

    You will see the `>>>` prompt:

    ```text theme={null}
    Python 3.13.5 (tags/v3.13.5, Jul 29 2025) [MSC v.1935 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    ```

    Run your first Python command:

    ```python theme={null}
    print("Hello from Python on Windows!")
    ```

    To exit the interpreter:

    ```python theme={null}
    exit()
    ```

    Or press **Ctrl + Z** then Enter.
  </Step>
</Steps>

## PATH setup explained

When you check "Add python.exe to PATH", the installer adds two directories to your system's `Path` environment variable:

```text theme={null}
C:\Users\<YourName>\AppData\Local\Programs\Python\Python313\
C:\Users\<YourName>\AppData\Local\Programs\Python\Python313\Scripts\
```

The first directory contains `python.exe` itself. The second contains `pip.exe` and other command-line tools installed with packages. Without both entries, the `python` and `pip` commands won't be found in your terminal.

## Troubleshooting

<AccordionGroup>
  <Accordion title="'python' is not recognized as a command" icon="circle-exclamation">
    This means Python was not added to PATH. You have two options:

    **Quick fix** — try the `py` launcher, which Windows installs separately:

    ```bash theme={null}
    py --version
    ```

    **Permanent fix — reinstall with PATH checked:**

    1. Open **Settings → Apps** and uninstall Python.
    2. Download the installer again from python.org.
    3. This time, **check "Add python.exe to PATH"** before installing.
    4. Close and reopen your terminal after installation.

    **Manual PATH fix (if you don't want to reinstall):**

    1. Search for **"Edit the system environment variables"** in the Start menu.
    2. Click **Environment Variables**.
    3. Under *User variables*, double-click **Path**.
    4. Click **New** and add:
       ```text theme={null}
       C:\Users\<YourName>\AppData\Local\Programs\Python\Python313
       C:\Users\<YourName>\AppData\Local\Programs\Python\Python313\Scripts
       ```
       Replace `<YourName>` with your Windows username and `Python313` with your actual version folder.
    5. Click **OK** on all dialogs, then **close and reopen** your terminal.
  </Accordion>

  <Accordion title="Typing 'python' opens the Microsoft Store" icon="store">
    Windows 10/11 includes a stub that redirects `python` to the Microsoft Store when the real Python isn't on your PATH. Disable it:

    1. Open **Settings → Apps → Advanced app settings → App execution aliases**.
    2. Turn **off** both Python-related aliases.
    3. Install Python from python.org and ensure PATH is set.

    The Microsoft Store version of Python has limitations (restricted file system access, no `pip` by default) that will cause problems later in the course.
  </Accordion>

  <Accordion title="Permission denied during installation" icon="lock">
    Right-click the installer `.exe` file and select **"Run as administrator"**. This resolves most permission errors during installation.

    If you see permission errors when running Python commands later, open Windows Terminal as administrator: right-click the Terminal icon in the taskbar → **Run as administrator**.
  </Accordion>

  <Accordion title="Windows Defender or SmartScreen blocks the installer" icon="ban">
    The Python installer is signed by the Python Software Foundation, so this warning is a false positive. When SmartScreen shows a warning:

    1. Click **"More info"**.
    2. Click **"Run anyway"**.

    If you prefer, you can verify the installer's integrity by checking the SHA256 hash published on python.org against the downloaded file.
  </Accordion>

  <Accordion title="Managing multiple Python versions" icon="code-branch">
    Windows installs a tool called the **Python Launcher** (`py`) that lets you run specific versions side by side.

    **List all installed versions:**

    ```bash theme={null}
    py -0
    ```

    **Run a specific version:**

    ```bash theme={null}
    py -3.13 --version
    py -3.12 script.py
    ```

    **Set a default version** by creating a `py.ini` file in your home folder (`C:\Users\<YourName>\`):

    ```ini theme={null}
    [defaults]
    python=3.13
    ```
  </Accordion>
</AccordionGroup>

## Next steps

<Card title="Continue to VS Code Introduction" icon="arrow-right" href="/getting-started/vscode-introduction">
  Install and configure Visual Studio Code as your Python editor.
</Card>
