Programming

'python' Is Not Recognized as an Internal or External Command: Every Fix

The five Windows messages behind 'python is not recognized', reproduced on Windows 11: PATH in cmd and PowerShell, the Microsoft Store alias, pip not recognized, two Pythons and VS Code.

Kausar RazaBy 6 min read327 views
Share:
python is not recognized as an internal or external command - every fix on Windows
  • programming
  • Python
  • Windows
Available for projects

Need help with this?

I build and fix business websites - fast, mobile-first and built to bring enquiries.

  • Fixed quote, no surprises
  • Speed & SEO built in
  • Reply within a few hours
Get a free quoteChat on WhatsApp

You install Python on Windows, open a terminal, type python and get this:

C:\>python --version
'python' is not recognized as an internal or external command,
operable program or batch file.

It almost never means Python failed to install. It means the terminal looked in every folder on your PATH and none of them had a python.exe in it. The fix depends on which of five similar messages you have, so this post starts there.

I reproduced each one on 20 November 2026 on a Windows 11 PC that has Python 3.13 (classic installer) and Python 3.14 (the new Python install manager) side by side. I didn't change any system settings. Instead I ran each command with a cut-down PATH, so every output below is copied from a real terminal. The one exception is the Microsoft Store message, which I couldn't trigger on this PC. That's explained in its section.

Table of five Windows messages: python is not recognized in cmd, the PowerShell cmdlet message, Python was not found Microsoft Store, pip is not recognized, and No module named after pip install, with the meaning and fix for each
The five messages, what each means and the fix.

First, check whether Python is installed at all

Before you touch any settings, try the launcher:

C:\>py --version
Python 3.14.3

C:\>py -c "import sys; print(sys.executable)"
C:\Users\you\AppData\Local\Python\pythoncore-3.14-64\python.exe

With my PATH stripped down to just C:\Windows, python failed but py still worked. On this PC the classic installer's launcher is C:\Windows\py.exe, a folder that is always on PATH, and the install manager provides py as an app alias. If py answers, Python is installed and only PATH is wrong. The second command prints where the real python.exe lives, and that folder is what you'll add. If py is also "not recognized", Python isn't installed. Get it from python.org (next section) rather than searching for a fix.

'python' is not recognized as an internal or external command (cmd)

This is cmd's wording. Python is installed, but its folder isn't on PATH, usually because the "Add python.exe to PATH" box in the installer wasn't ticked. You have two ways out:

  1. Just use py. py script.py, py -m pip install ... and py -m venv .venv all work without any PATH change. For many people this is the whole fix.
  2. Add the folder to PATH. Press Start, type "environment variables", open Edit environment variables for your account, select Path, click Edit, then New, and add the folder that sys.executable printed. The usual folders are:
# Python install manager (python.org's recommended installer since 3.14)
%LocalAppData%\Python\bin

# classic python.org installer, "just for me"
%LocalAppData%\Programs\Python\Python313
%LocalAppData%\Programs\Python\Python313\Scripts

Then close the terminal and open a new one. A terminal reads PATH once, when it starts, so the old window keeps saying "not recognized" even after the fix is correct. That catches a lot of people.

The Python docs now recommend the Python install manager from python.org. They say the traditional full installer is "deprecated since 3.14 and will not be produced for Python 3.16 or later". The install manager asks once whether to add %LocalAppData%\Python\bin to PATH. Say yes.

The term 'python' is not recognized as the name of a cmdlet (PowerShell)

PS C:\> python --version
python : The term 'python' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path
is correct and try again.
    + CategoryInfo          : ObjectNotFound: (python:String) [], CommandNotFoundException

Same cause, PowerShell's wording: CommandNotFoundException means no folder on PATH holds a python.exe. The fixes are the same as above. One PowerShell-only trap: if Python's folder is on PATH and you still get this, check that you aren't typing python3. The classic installer doesn't create a python3.exe. The install manager does, but its docs say it is "not meant to be widely used or recommended". On Windows, use python or py.

"Python was not found; run without arguments to install from the Microsoft Store"

This message comes from Windows, not from Python:

Python was not found; run without arguments to install from the Microsoft Store,
or disable this shortcut from Settings > Manage App Execution Aliases.

Windows ships a python.exe placeholder in %LocalAppData%\Microsoft\WindowsApps, which is on PATH by default. If no real Python comes earlier in PATH, the placeholder runs. With arguments it prints this message, and with none it opens the Store page. I couldn't reproduce it here because on this PC the WindowsApps aliases point at the installed Python install manager, which is how the install manager provides python and py. So the text above is Windows' own message, quoted as users report it.

The fixes:

  • No Python installed: install the Python install manager from python.org. Its aliases replace the placeholder.
  • Python installed with the classic installer: put its folder above WindowsApps in Path, or open Start, search "Manage app execution aliases" and switch off the two "App Installer python.exe / python3.exe" entries.
  • Using the install manager and python still opens the Store: the Python docs' advice is to open "Manage app execution aliases" and make sure the "Python (default)" aliases are on. If they already are, switch them off and on again. Also check that WindowsApps is still on PATH, because the install manager's commands live there.

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

This one has its own cause. I put C:\Python313 on PATH but left out its Scripts folder, which is a common half-finished manual fix:

C:\>python --version
Python 3.13.5

C:\>pip --version
'pip' is not recognized as an internal or external command,
operable program or batch file.

C:\>python -m pip --version
pip 25.3 from C:\Python313\Lib\site-packages\pip (python 3.13)

pip.exe lives in Scripts, not next to python.exe. You can add Scripts to PATH as well, but there's a better habit: always run pip through Python.

python -m pip install requests        # installs for exactly the python you run
py -3.14 -m pip install requests      # or pick the version explicitly
python -m pip --version               # shows which Python pip belongs to

python -m pip works whenever python works, and it can't install into the wrong Python. That second point matters, as the next section shows.

pip install worked, but "No module named ..." anyway

If you have more than one Python, python, py and pip can each point at a different one. On my PC:

C:\>where python
C:\Python313\python.exe
C:\Users\you\AppData\Local\Microsoft\WindowsApps\python.exe
C:\Users\you\AppData\Local\Python\bin\python.exe

C:\>python --version
Python 3.13.5

C:\>py --version
Python 3.14.3

python runs 3.13, because C:\Python313 comes first in PATH. py runs 3.14, the install manager's default. And pip is 3.13's. Pillow is installed for 3.13 only, so the same two-line script behaves differently depending on the command:

C:\>python check.py
PIL 10.4.0

C:\>py check.py
Traceback (most recent call last):
  File "check.py", line 1, in <module>
    import PIL
ModuleNotFoundError: No module named 'PIL'

Nothing is broken. The package was installed for one interpreter and the script ran on the other. The fix is python -m pip (or py -m pip) with the same command you use to run the script, and where python shows you which Python runs first. A virtual environment removes the question entirely:

py -m venv .venv
.venv\Scripts\activate
python -m pip install -r requirements.txt

Inside an activated venv, python and pip both belong to the venv, whatever PATH says.

Python not recognized in the VS Code terminal

VS Code's integrated terminal inherits PATH from VS Code, and VS Code read it when it started. If you changed PATH while VS Code was open, close all VS Code windows and start it again. Opening a new terminal tab isn't enough. If it still fails, open a normal cmd window and run where python. If it fails there too, the problem is PATH, not VS Code. For running and debugging, VS Code uses the interpreter you choose with Python: Select Interpreter (Ctrl+Shift+P). Pick the same one you install packages into.

Quick checklist

  1. py --version works? Python is installed. Use py, or add the folder from sys.executable to PATH.
  2. Changed PATH? Open a new terminal, or restart VS Code completely.
  3. Store message? Install Python from python.org, or fix the app execution aliases.
  4. pip not recognized? Use python -m pip.
  5. "No module named" after installing? Compare where python with python -m pip --version, or use a venv.

Once Python runs, local AI tools are a common next step. My guide to running DeepSeek R1 locally on Windows, macOS and Linux picks up from there.

Frequently asked questions

Why is python not recognized as an internal or external command?
Windows can't find python.exe in any folder on your PATH. Python is usually installed, but its folder wasn't added, often because the 'Add python.exe to PATH' box was unticked. Try py --version: if it works, either use py or add Python's folder to PATH and open a new terminal.
How do I add Python to PATH on Windows 11?
Run py -c "import sys; print(sys.executable)" to find the folder. Then open Start, search 'environment variables', choose 'Edit environment variables for your account', edit Path, add that folder (and its Scripts folder for pip), and open a new terminal.
What does 'Python was not found; run without arguments to install from the Microsoft Store' mean?
Windows ran its placeholder python.exe from the WindowsApps folder because no real Python came earlier on PATH. Install Python from python.org, or if Python is already installed, move its folder above WindowsApps in Path or turn off the python.exe app execution aliases.
Why is pip not recognized when python works?
pip.exe is in Python's Scripts folder, which is a separate PATH entry. Use python -m pip install requests (or any package name) instead. It always uses the same Python you run, so packages can't end up in a different interpreter.
What is the difference between py and python on Windows?
python runs whichever python.exe comes first on PATH. py is the launcher, which picks an installed version itself (the newest or the configured default) and accepts -3.13 or -V:3.14 to choose. On a PC with two versions they can run different Pythons.
Why do I get No module named after pip install?
pip installed the package into a different Python than the one running your script. Run pip as python -m pip (or py -m pip) using the same command you run the script with, check with where python, or use a virtual environment.
Why is python still not recognized in VS Code after fixing PATH?
VS Code reads PATH when it starts, and its terminals inherit that copy. Close every VS Code window and reopen it. Also select the interpreter with Python: Select Interpreter so running and debugging use the same Python.

Join the conversation

No comments yet — be the first to share what you think.

Leave a comment

Never published.

Optional.

Keep reading

Related articles

View all