If you’ve ever tried running Python on Windows only to see the error:

'python' is not recognized as an internal or external command

—you’re not alone. This issue occurs when Windows can’t locate Python’s executable in your system’s PATH. Luckily, there are several simple ways to fix it, so you can run Python and pip from any terminal without typing full directory paths every time.

In this guide, we’ll walk through four proven methods to solve this problem, explain common pitfalls, and show you how to verify your setup. Whether you installed Python from python.org or the Microsoft Store, you’ll find the right fix here.

This article is part of the “Python Guide” collection, a complete series of tutorials and resources designed to help you learn Python from scratch and master advanced Python programming with ease.

Why This Error Happens

Windows searches for programs in the PATH environment variable. If Python’s installation directory isn’t included, the terminal won’t recognize the python or pip commands. See the Python Software Foundation’s documentation at docs.python.org.

READ 👉  Scikit-learn: The Essential Machine Learning Library for Python

Fixing it means either:

  • Adding the correct directories to PATH, or
  • Using the Python Launcher (py.exe), which handles version management automatically.

Method 1 — Add Python to PATH Using the Installer (Recommended)

The easiest fix is using the official Python installer from python.org, which can automatically configure PATH for you.

Steps:

1- Download the latest installer from python.org.

2- Run the installer and click Install Now (or Customize installation).

3- On the first page, check “Add python.exe to PATH.”

4- Complete the installation.

5- Close and reopen Command Prompt or PowerShell.

6- Verify installation:

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

💡 Tip: If Python is already installed, rerun the installer → select Modify → enable Add python.exe to PATH → finish and reopen your terminal. see the Python docs at docs.python.org.

Method 2 — Manually Add Python to PATH (User-Level)

If you installed Python without adding it to PATH, you can configure it manually. This approach only affects your user account (no admin rights needed).

Steps:

1- Press Win+R, type sysdm.cpl, and hit Enter.

2- Go to the Advanced tab → click Environment Variables…

3- Under User variables, select Path → click Edit.

4- Click New and add your Python install directory, e.g.: C:\Users\<YourName>\AppData\Local\Programs\Python\Python311

5- Click New again and add the Scripts directory: C:\Users\<YourName>\AppData\Local\Programs\Python\Python311\Scripts

6- Use Move Up to place these entries near the top.

7- Save changes, close all windows, and restart your terminal.

8- Verify with:

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

⚠️ Common mistakes to avoid:

  • No trailing backslashes (…\Python311 ✅ | …\Python311\ ❌)
  • No extra spaces before paths
  • Remove invalid entries in PATH that point to missing folders

Method 3 — Fix Microsoft Store Installs with App Execution Aliases

If you installed Python via the Microsoft Store, it relies on App Execution Aliases instead of direct PATH edits.

READ 👉  How to Call Functions in Python (Step-by-Step Guide)

Steps:

1- Open Windows Settings → search for Manage App Execution Aliases.

2- Enable or disable Python aliases (python.exe, python3.exe) depending on which version you want.

3- Ensure your user PATH includes WindowsApps: C:\Users\<YourName>\AppData\Local\Microsoft\WindowsApps

4- Reopen your terminal and check:

python --version
python3 --version
where python

💡 Tip: If typing python opens the Microsoft Store instead of running Python, disable the alias for that command and rely on your python.org install or use the Python Launcher.

Method 4 — Use the Python Launcher (Best for Multiple Versions)

The Python Launcher (py.exe) is included with python.org installations and eliminates PATH headaches by automatically detecting installed versions.

Steps:

1- Check if the launcher is available: py --version

2- Run Python with version tags:

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

3- Create a virtual environment:

py -3.11 -m venv venv
venv\Scripts\activate
python --version

💡 Bonus: Use py --list to see all detected runtimes and pin versions per project without editing PATH. Details are covered in the Python docs under “Python Launcher for Windows” at docs.python.org.

Quick Troubleshooting Checklist

If things still don’t work, try these steps:

Run:

where python
where python3
where py

Confirm pip is available:

pip --version
where pip

If Python opens the Microsoft Store, disable the alias in App Execution Aliases.

Restart Command Prompt, PowerShell, or even log out/in to reload environment variables.

✅ Conclusion

The dreaded “’python’ is not recognized as an internal or external command” error on Windows is usually a simple PATH misconfiguration.

  • If you’re new: use the official installer with PATH enabled.
  • If you already installed Python: manually add directories to PATH or use App Execution Aliases.
  • For advanced setups with multiple versions: rely on the Python Launcher (py.exe).

Once configured, you can run Python and pip from anywhere, manage multiple versions effortlessly, and focus on coding without environment hassles.

❓ Frequently Asked Questions (FAQ)

1. Why does Windows say “’python’ is not recognized as an internal or external command”?

This happens because Windows cannot find the Python executable in your PATH. Without the correct PATH setup, the terminal doesn’t know where Python is installed.

READ 👉  How to Scrape Google Jobs into CSV — Full Guide with Oxylabs, SerpApi & Selenium

2. How do I check if Python is installed correctly on Windows?

Open Command Prompt and run:

python --version

If it shows a version number, Python is installed. If you get the error, Python isn’t in PATH, or the install is broken.

3. Do I need administrator rights to fix this error?

No. You can add Python to your user-level PATH without admin rights. Administrator access is only required if you want to set system-wide PATH changes for all users.

4. Why does typing python open the Microsoft Store?

This happens if you installed Python via the Microsoft Store and the “App Execution Alias” setting is enabled. Disable the alias in Windows Settings → App Execution Aliases to prevent the Store from opening.

5. What’s the difference between using PATH and the Python Launcher (py)?

  • PATH method → lets you call python and pip directly.
  • Python Launcher (py.exe) → auto-detects installed Python versions and avoids PATH conflicts. It’s the best option if you work with multiple Python versions.

6. How can I verify if pip is installed and working?

Run:

pip --version

If it shows a version number, pip is installed. If not, ensure the Scripts folder is added to PATH or reinstall Python with the “Add pip” option enabled.

7. Do I need to restart my computer after editing PATH?

Not always. Usually, closing and reopening the terminal (Command Prompt or PowerShell) is enough. In some cases, you may need to sign out and sign back in for changes to take effect.

Did you enjoy this article? Feel free to share it on social media and subscribe to our newsletter so you never miss a post!

And if you'd like to go a step further in supporting us, you can treat us to a virtual coffee ☕️. Thank you for your support ❤️!
Buy Me a Coffee

Categorized in: