Sythra

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.

vaibhavkothari· Aug 26, 2026· 5 min readBeginner
ShareXLinkedIn
'pip' is not recognized — fix it on Windows in 5 minutes cover

'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:

ResultMeaningGo to
Both print versionsPython is fine, only pip is missing from PATHStep 2
python opens the Microsoft StoreWindows app-execution alias is hijacking itStep 4
python is also not recognizedPython is not on PATH at allStep 3
No module named pippip is genuinely missingStep 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:

  1. Press Win, type environment variables, open Edit the system environment variables
  2. Click Environment Variables…
  3. Under User variables, select PathEdit
  4. Click New, paste the Scripts path
  5. Click New again and paste the folder above it too (the one holding python.exe)
  6. 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:

  1. Download Python from python.org/downloads
  2. Run the installer
  3. Tick "Add python.exe to PATH" at the bottom of the first screen — this is the step everyone misses
  4. Choose Install Now
  5. 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.

  1. Press Win, type Manage app execution aliases
  2. Turn off the toggles for python.exe and python3.exe
  3. 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)

ProblemFix
Edited PATH but nothing changedOpen a new terminal; PATH is only read at startup
Works in PowerShell, fails in VS CodeRestart VS Code completely, not just the terminal panel
Defaulting to user installation warningHarmless. It means you are installing without admin rights
Access is deniedAdd --user, or use a virtual environment
Two Pythons fight each otherUse 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.

Next reading on Sythra Articles

Keep reading

Related articles

Newsletter

Get new articles

Free essays on learning, Python, and ML — no account required. We’ll only email when there’s something worth reading.