'python' is not recognized as an internal or external command” appears when Windows can’t find Python’s executable on the PATH. Adding the right directories—or using the Python Launcher—lets you run Python and pip from any terminal without full paths.

Reference: Official guidance on PATH, the installer option, and the Python Launcher is in the Python docs under “Using Python on Windows.” See the Python Software Foundation’s documentation at docs.python.org.

What you’ll need

  • Windows 11 with a Python install (from python.org or Microsoft Store).
  • Administrator rights only if modifying system-wide variables; user-level changes do not require admin.
  • A fresh terminal session after any PATH change.

Why this works: The python.org installer can set PATH for you, avoids common typos, and also adds the Scripts folder that pip uses. The same installer can “Modify” an existing install to add PATH later. The Python docs note the “Add Python to PATH” option on the first installer page and allow toggling it post‑install.

Step 1: Run the Python installer from python.org.

Step 2: Click Install Now or Customize installation if installing fresh.

Step 3: Check Add python.exe to PATH on the first page.

Step 4: Complete the installation.

Step 5: Close and reopen Command Prompt or PowerShell.

Step 6: Verify Python and pip are available.

python --version
pip --version
where python
where pip
Tip: If Python is already installed, rerun the installer, choose Modify, enable Add python.exe to PATH, then finish and reopen your terminal. For more on installer behavior and PATH, see the Python docs at docs.python.org (linked above).

Method 2 — Manually add Python to PATH (user-level)

When to use: If you installed Python without enabling PATH or you’re aligning an existing install. This method targets your user PATH, avoiding system-wide changes.

Step 1: Press Win+R, type sysdm.cpl, and press Enter.

Step 2: Select the Advanced tab and click Environment Variables….

Step 3: Under User variables, select Path and click Edit.

Step 4: Click New and add your Python install directory (for example: C:\Users\<you>\AppData\Local\Programs\Python\Python311).

Step 5: Click New and add the Scripts directory (for example: C:\Users\<you>\AppData\Local\Programs\Python\Python311\Scripts).

Step 6: Use Move Up to place these entries near the top so this Python is found first.

Step 7: Click OK on all dialogs to save changes.

Step 8: Close and reopen Command Prompt or PowerShell.

Step 9: Verify the commands resolve to your paths.

python --version
pip --version
where python
where pip

Notes and pitfalls:

  • Avoid trailing backslashes in entries (use C:\Path\To\Python311, not C:\Path\To\Python311\).
  • Do not insert leading spaces; each entry should be a clean path line.
  • Ensure earlier PATH entries aren’t pointing at non-existent folders; invalid directories can cause confusing resolution behavior.
  • Restart the shell after changes; some setups require sign-out/sign-in.

Method 3 — Fix Microsoft Store installs with App Execution Aliases

When to use: If Python was installed via the Microsoft Store. Store-based Python relies on “App execution aliases” and the WindowsApps directory rather than traditional PATH edits.

Step 1: Open Windows Settings and search for Manage App Execution Aliases.

Step 2: Turn on the toggles for the Python version you want to launch via python.exe and python3.exe, or turn them off to avoid conflicts with a python.org install.

Step 3: Ensure your user PATH includes WindowsApps so the alias resolves: C:\Users\<you>\AppData\Local\Microsoft\WindowsApps.

Step 4: Reopen your terminal and confirm the commands use your chosen alias.

python --version
python3 --version
where python
Tip: If the alias launches the Store instead of Python, disable the alias for that command and rely on your python.org install, or use the Python Launcher (py) described below.

Method 4 — Use the Python Launcher instead of editing PATH

Why consider this: The Python Launcher (py.exe) is installed with python.org builds and correctly locates installed versions by tag, avoiding PATH conflicts. The official docs emphasize the Launcher’s version selection and discovery behavior.

Step 1: Check the launcher version.

py --version

Step 2: Run the desired Python version explicitly.

py -3
py -3.11
py -3.10 -m pip --version

Step 3: Create and use virtual environments with the launcher.

py -3.11 -m venv venv
venv\Scripts\activate
python --version
Notes: You can list detected runtimes with py --list and pin versions per project without touching PATH. Details are covered in the Python docs under “Python Launcher for Windows” at docs.python.org (linked once above).

Quick verification and troubleshooting

Step 1: Confirm which executable runs.

where python
where python3
where py

Step 2: Validate pip and Scripts.

pip --version
where pip

Step 3: If python opens the Microsoft Store, disable the corresponding App Execution Alias, or rely on py to launch the intended version.

Step 4: If changes don’t apply, fully close terminals and GUI IDEs or sign out and back in so the updated environment is loaded.


Once PATH is set (or the Launcher is in use), you can run Python and pip anywhere and avoid full paths. For multi-version setups, prefer the Python Launcher to pick exact versions reliably and keep projects isolated with virtual environments.