'python' is not recognized as an internal or external command
1 · The lesson
readWhat this error means
Windows looked for a program calledpython in every folder listed in your PATH environment variable and didn't find one. Python may well be installed — the terminal just doesn't know where. This is not a Python error at all; Python never started.
When you see it
In Command Prompt:C:\Users\Ada> python --version 'python' is not recognized as an internal or external command, operable program or batch file.
In PowerShell the same problem reads differently:
PS C:\Users\Ada> python --version python : The term 'python' is not recognized as the name of a cmdlet, function, script file, or operable program.
And on a recent Windows, you may instead get a third version:
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
Why it happens
Four causes, in rough order of how often they bite:1. The installer's "Add python.exe to PATH" box was left unticked. It's the first screen of the python.org installer, and it's off by default.
2. The terminal was already open when you installed Python. A terminal reads PATH once, when it starts.
3. Windows' Store shortcut is answering instead. Windows ships a fake python.exe that opens the Microsoft Store — that's the third message above.
4. Python genuinely isn't installed.
How to fix it
Option 1 — use py, which almost certainly already works. The python.org installer puts the Python Launcher, py, on your PATH whether or not you ticked the box.
py --version py my_script.py py -m pip install requests
If py --version prints a version, Python is installed and you can stop here. Use py wherever a tutorial says python.
Option 2 — close the terminal and open a new one. If you installed Python a minute ago, this fixes it more often than anything else.
Option 3 — re-run the installer and tick the box. Run the installer again, choose Modify, click through to Advanced Options, tick Add Python to environment variables, and finish. Open a new terminal.
Option 4 — add the folders to PATH yourself. For a per-user install of Python 3.13, the two folders are:
%LOCALAPPDATA%\Programs\Python\Python313\ %LOCALAPPDATA%\Programs\Python\Python313\Scripts\
Start menu → Edit environment variables for your account → Path → Edit → New, once for each. The second folder is the one that makes pip work too.
Seeing the Microsoft Store message? Settings → Apps → Advanced app settings → App execution aliases, and switch off both App Installer python.exe and python3.exe. Then Option 3 or 4.
To check what Windows finds after any fix:
where python
It should print a path ending in Python313\python.exe, not one under WindowsApps.
When you'd actually see this in real code
- The first line of almost every tutorial,
python --version, on a brand-new Windows laptop. - VS Code's terminal was open during the install; the one you open afterwards works.
'pip' is not recognized— the same problem, with theScriptsfolder missing from PATH.py -m pipsidesteps it entirely.- A batch file or scheduled task that calls
pythonworks when you run it and fails for another user, whose PATH doesn't have it.
Related errors
- error: externally-managed-environment — the macOS and Linux side of "which Python is this?"
- ModuleNotFoundError: No module named 'X' — once Python starts, the next thing that goes wrong is usually installing into a different Python than the one you run.
See Also
- All Python errors — the full index, by type and by when it happens.
- Introduction to Python — or skip installing entirely: the playground runs Python in your browser.
- Virtual environments — one Python per project, so PATH stops mattering.