Article
'pip' is not recognized — fix it on Windows in 5 minutes
Windows says pip is not recognized as an internal or external command because pip is not on your PATH. Use python -m pip for an instant fix, then repair PATH properly.
On this page0%
- The instant fix
- Step 1 — Check what Windows can actually see
- Step 2 — Add the Scripts folder to PATH
- Step 3 — Reinstall Python with the checkbox ticked
- Step 4 — Turn off the Microsoft Store alias
- Step 5 — Repair pip itself
- Step 6 — Prove it works end to end
- Common mistakes (and fixes)
- Why python -m pip is the better habit
- FAQ
- How do I fix 'pip' is not recognized on Windows?
- Why is pip not recognized even though Python is installed?
- Where is pip.exe located on Windows?
- What is the difference between pip and python -m pip?
- Why does typing python open the Microsoft Store?
- Next reading on Sythra Articles
'pip' is not recognized as an internal or external command, operable program or batch file.
This message is Windows saying: "I looked in every folder on my list and there is no program called pip." It does not mean pip is missing. Python ships with pip. Windows just does not know where it lives.
There is a one-line workaround you can use right now, and a permanent fix that takes five minutes. Do both.
The instant fix
Instead of pip, run pip through Python:
python -m pip install requests
python -m pip means "run the pip module that belongs to this Python". It works even when pip is not on the PATHThe list of folders Windows searches when you type a command, and it is the command experienced developers use anyway, because it can never install into the wrong Python.
If python also fails, jump to Step 3.
Step 1 — Check what Windows can actually see
Open PowerShell and ask:
python --version
python -m pip --version
Read the result carefully — each outcome points to a different fix:
| Result | Meaning | Go to |
|---|---|---|
| Both print versions | Python is fine, only pip is missing from PATH | Step 2 |
python opens the Microsoft Store | Windows app-execution alias is hijacking it | Step 4 |
python is also not recognized | Python is not on PATH at all | Step 3 |
No module named pip | pip is genuinely missing | Step 5 |
Step 2 — Add the Scripts folder to PATH
pip lives in a folder called Scripts next to python.exe. Find it:
python -c "import sys, os; print(os.path.join(sys.prefix, 'Scripts'))"
You get something like C:\Users\You\AppData\Local\Programs\Python\Python312\Scripts.
Add it permanently:
- Press
Win, type environment variables, open Edit the system environment variables - Click Environment Variables…
- Under User variables, select Path → Edit
- Click New, paste the
Scriptspath - Click New again and paste the folder above it too (the one holding
python.exe) - OK out of all three windows
Now close every terminal and open a new one. PATH is read when a terminal starts, so old windows keep the old list. Test:
pip --version
Step 3 — Reinstall Python with the checkbox ticked
If python itself is not recognized, the installer was run without the PATH option. Fixing it is easy:
- Download Python from python.org/downloads
- Run the installer
- Tick "Add python.exe to PATH" at the bottom of the first screen — this is the step everyone misses
- Choose Install Now
- Open a brand-new terminal and run
python --version
Already installed? Run the installer again, choose Modify, then Add Python to environment variables.
Step 4 — Turn off the Microsoft Store alias
Windows ships fake python.exe and python3.exe files that open the Store instead of running Python. They shadow your real install.
- Press
Win, type Manage app execution aliases - Turn off the toggles for python.exe and python3.exe
- Open a new terminal and try again
Step 5 — Repair pip itself
Rare, but it happens after a partial install:
python -m ensurepip --upgrade
python -m pip install --upgrade pip
ensurepip is a small tool bundled with Python whose only job is putting pip back.
Step 6 — Prove it works end to end
python -m pip install requests
python -c "import requests; print(requests.get('https://example.com').status_code)"
A printed 200 means Python, pip, and your network are all healthy. You are ready to install anything — including the OpenCV setup from our virtual mouse project.
Common mistakes (and fixes)
| Problem | Fix |
|---|---|
| Edited PATH but nothing changed | Open a new terminal; PATH is only read at startup |
| Works in PowerShell, fails in VS Code | Restart VS Code completely, not just the terminal panel |
Defaulting to user installation warning | Harmless. It means you are installing without admin rights |
Access is denied | Add --user, or use a virtual environment |
| Two Pythons fight each other | Use py -3.12 -m pip install ... to pick one explicitly |
Why python -m pip is the better habit
Even after PATH is fixed, keep using python -m pip. On a machine with several Pythons, plain pip may belong to a different one — which is exactly how you end up with No module named 'cv2' right after a "successful" install. python -m pip removes the ambiguity for good.
FAQ
How do I fix 'pip' is not recognized on Windows?
Run python -m pip install <package> for an immediate fix, then add Python's Scripts folder to your PATH environment variable and open a new terminal so the change takes effect.
Why is pip not recognized even though Python is installed?
Python was installed without ticking "Add python.exe to PATH", so Windows does not know which folder holds pip.exe. The program exists; the shortcut to it does not.
Where is pip.exe located on Windows?
Inside the Scripts folder next to python.exe. Print the exact path with python -c "import sys, os; print(os.path.join(sys.prefix, 'Scripts'))".
What is the difference between pip and python -m pip?
pip runs whichever pip Windows finds first on the PATH. python -m pip runs the pip belonging to the Python you just invoked, so packages always land in the interpreter you expect.
Why does typing python open the Microsoft Store?
Windows includes app-execution aliases that redirect python to the Store. Disable them under Settings → Manage app execution aliases.