How to Fix the ‘pip is not recognized’ Error in Python on Windows

You installed Python. You opened Command Prompt, typed pip install and the name of a library — and Windows answered with this:

'pip' is not recognized as an internal or external command, operable program or batch file.

Many Python beginners hit this wall early on, usually right when a tutorial tells them to install their first library. The good news: Python is almost certainly installed fine. Windows simply does not know where to look for pip, which is why you see the pip is not recognized error. This guide walks through the fixes in the order you should try them — the quick workaround first, then the permanent repair. If the pip is not recognized error appears again, work through the fixes below in order.

What the pip is not recognized error actually means

When you type a command, Windows searches a list of folders called the PATH to find a program with that name. pip is Python’s package installer — the tool that downloads libraries like NumPy, Flask or requests. If the folder containing pip is not in that PATH list, Windows gives up and shows the pip is not recognized message.

So this is not a Python error and not a broken library. It is a directions problem: the program exists, but Windows has lost the address.

Three situations cause it in practice:

  • Python was installed without ticking the “Add Python to PATH” option (the most common reason — the checkbox is easy to miss).
  • You have more than one Python version installed, and the PATH points to an old or empty folder.
  • The python command itself works, but the Scripts folder (where pip lives) is missing from the PATH.

Fix 1: Use the py launcher (works in 30 seconds)

Before changing any settings, try this. Windows installations of Python also include a small launcher called py. Open Command Prompt and type:

py -m pip --version

If you see a version line such as pip 25.x (your version number will differ) from C:\..., everything is installed — only the shortcut name pip is missing. You can simply use py -m pip in place of pip from now on:

py -m pip install requests

This is not a second-class workaround. Many experienced developers prefer py -m pip because it guarantees the library goes into the Python version you expect, which matters once you have more than one version installed. If this fix works, you can stop here — or continue to Fix 2 if you want plain pip to work too. For background, see Python’s official guide to installing modules.

Fix 2: Repair the installation so PATH is added for you

If you installed Python from python.org, the installer can fix the PATH itself. This is safer than editing system settings by hand:

  1. Open Settings → Apps → Installed apps, find your Python version, and choose Modify (or run the original installer file again and choose Modify).
  2. On the Optional Features screen, click Next.
  3. On the Advanced Options screen, tick “Add Python to environment variables”.
  4. Click Install, let it finish, then close Command Prompt completely and open a fresh one — old windows keep the old PATH.
  5. Test with pip --version.

Reopening the terminal is the step people skip when fixing the pip is not recognized error, and then they conclude the fix failed. Environment variable changes only apply to newly opened windows.

Fix 3: Add Python to PATH manually

Use this if Fix 2 is not available (for example, Python came from another source) — or if python works but pip alone does not.

First, find where Python lives. Run py -0p in Command Prompt; it lists your installed versions and their folders, something like C:\Users\YourName\AppData\Local\Programs\Python\Python312\. You need two folders:

  • the main folder itself (for python)
  • the Scripts folder inside it (for pip)

Then add both:

  1. Press the Windows key, type “environment variables”, and open “Edit the system environment variables”.
  2. Click Environment Variables, select Path in the top (user) box, and click Edit.
  3. Click New and add the Python folder; click New again and add the Scripts folder.
  4. OK out of every dialog, open a new Command Prompt, and test pip --version.

If python worked before but pip did not, adding the Scripts folder alone is usually the missing piece.

If you installed Python from the Microsoft Store

The Store version manages its own shortcuts, and the pip is not recognized error sometimes still appears. Two things usually sort it out: use py -m pip as in Fix 1, or check Settings → Apps → Advanced app settings → App execution aliases and make sure the Python aliases are switched on. If you are learning seriously and following tutorials, many beginners find the python.org installer easier to reason about, because its folders and PATH behaviour match what tutorials assume.

Mistakes that make the pip is not recognized error come back

  • Running the command in the wrong window. VS Code’s integrated terminal, Command Prompt and PowerShell are separate windows with their own sessions. After any PATH fix, close and reopen whichever one you use.
  • Installing a second Python “just to test”. Two versions competing for the PATH is the most common reason the error returns a month later. One clean installation, plus virtual environments for projects, is the stable setup — our guide to learning Python step by step shows how that routine looks in practice.
  • Typing pip commands inside the Python shell. If your prompt shows >>>, you are inside Python itself. pip commands belong in Command Prompt or PowerShell, not at the >>> prompt. Type exit() first.
  • Assuming pip is broken and reinstalling everything. Reinstalling on top of a messy PATH usually keeps the mess. Fix the PATH; pip is almost never the broken part.

A two-minute check before you move on

Once pip --version answers cleanly, confirm the whole chain works with one harmless library: This check confirms the pip is not recognized error is fully cleared before you move on.

pip install requests

Then open Python and run import requests — if no error appears, you are done. Library installs in tutorials should now work as expected. And if you are setting up your editor at the same time, these VS Code extensions for Python developers pair well with a clean installation.

Frequently asked questions

Why does python work but pip is not recognized?

They live in different folders. python sits in the main Python folder; pip sits in the Scripts folder inside it. If only the main folder was added to the PATH, you get exactly this split behaviour — Fix 3 adds the missing folder.

Is py -m pip the same as pip?

Yes — it runs the same installer through the Python launcher. The only difference is that it is explicit about which Python installation the library goes into, which is why experienced developers often prefer it.

Do I need to restart my computer after changing the PATH?

No. Closing and reopening your terminal window is enough; new windows read the updated PATH.

The error appears in VS Code but not in Command Prompt. Why?

VS Code was probably already open when the PATH changed, so its integrated terminal still holds the old settings. Restart VS Code completely and open a new terminal inside it.

Will fixing this delete my installed libraries?

No. Changing the PATH only changes how Windows finds programs. Your Python installation and anything you already installed stay untouched. The pip is not recognized error does not delete anything.

About the Author

Ayush Rai

Ayush Rai is the Founder & Content Creator of PowerBean, where he writes and reviews beginner-friendly coding guides, programming tutorials and developer career advice. Based in Noida, India, he focuses on practical, easy-to-follow explanations that help new developers learn and grow. He also publishes NinjaWay, a careers and placements guide for freshers.

View all posts by Ayush Rai

Leave a Comment