"Python Is Not Recognized as an Internal or External Command": How to Fix It
Windows can't find Python on your PATH. Check it's installed, try the py launcher, add it to PATH and turn off the Store alias. Fixes "pip is not recognized" too.
'python' is not recognized as an internal or external command,
operable program or batch file.
or in PowerShell:
python : The term 'python' is not recognized as the name of a cmdlet, function,
script file, or operable program.
Windows is telling you it looked for a program called python in every folder on your PATH and didn't find one. Either Python isn't installed, or it's installed but Windows doesn't know where. The same applies to pip is not recognized.
Step 1: Try the py launcher
The official Python installer for Windows includes a launcher called py that works even when PATH isn't set up:
py --version
py -m pip --version
If py works, Python is installed — you can use py instead of python, and py -m pip install requests instead of pip install requests. That's a perfectly good long-term habit.
Step 2: Install Python if it isn't there
Install the Python install manager from python.org and follow the current Windows setup guide; it manages runtimes through py and Windows execution aliases. If you're using an older, traditional installer instead, tick "Add python.exe to PATH" on its first screen.
After installing, close and reopen your terminal. Already-open windows don't see PATH changes.
Step 3: Add Python to PATH manually
If Python is installed but PATH wasn't set:
- Find where it lives. It's often
C:\Users\<you>\AppData\Local\Programs\Python\Python3XX\. - Open Start → search "Edit environment variables for your account".
- Select Path → Edit → New, and add two entries:
C:\Users\<you>\AppData\Local\Programs\Python\Python3XX\C:\Users\<you>\AppData\Local\Programs\Python\Python3XX\Scripts\
- Click OK, then open a new terminal.
The Scripts folder is where pip.exe and other tools live — that's why pip can fail even when python works.
Step 4: The Microsoft Store trap
Windows ships with "app execution aliases" so that typing python opens the Microsoft Store. If you installed Python from python.org, those aliases can get in the way — python opens the Store instead of running your Python.
For a traditional installation, disable conflicting App Installer / Microsoft Store aliases under Settings → Apps → Advanced app settings → App execution aliases. If you're using the new Python install manager, keep its Python (default) aliases enabled instead — it uses those aliases to launch your selected runtime.
Step 5: Check which Python you're getting
where.exe python
python --version
where.exe works in both PowerShell and Command Prompt; bare where is a PowerShell alias for Where-Object. If several Python executables are on PATH, the first one is normally selected; the install manager can additionally choose the runtime behind its alias.
On Mac and Linux
The equivalent is zsh: command not found: python. Modern macOS and many Linux distributions only provide python3, not python:
python3 --version
python3 -m pip --version
Use a virtual environment for projects and the python command will work inside it.
The summary
- Windows can't find Python on your PATH.
- Try
pyfirst. Reinstall with "Add python.exe to PATH" ticked, or add it by hand. - Turn off the Microsoft Store aliases, and reopen your terminal after changes.
EasySpawn gives you a Linux server with Python ready to go and Claude Code to set up virtual environments and dependencies — no Windows PATH wrangling. See how it works or join the waitlist.
Keep reading
"You Have Divergent Branches" in git pull: What It Means and How to Fix It
git pull says "you have divergent branches" when local and remote both have new commits. Pick merge, rebase or fast-forward, and set a default so git stops asking.
How to Check Disk Space and Memory Usage on Linux
The commands to see what's using your server's disk and memory: df -h for free disk space, du and ncdu to find big folders, free -h for memory (and why 'free' memory looks low), and top/htop for which process is using RAM and CPU — plus how to clean up safely.