Skip to content

Fix ‘pip’ is Not Recognized as an Internal or External Command Error in Windows

4 min read

Fix: ‘pip’ is Not Recognized as an Internal or External Command in Windows

If you’re working with Python and suddenly encounter the error message:

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

You’re not alone. This is one of the most common problems new Python developers face, especially on Windows systems. Thankfully, the fix is straightforward once you understand what’s causing it.

In this article, we’ll walk you through:

  • Why this error happens
  • How to check if pip is installed
  • How to fix the PATH environment variable
  • Permanent and temporary fixes
  • Tips for avoiding it in the future

Let’s dive in.


🔍 Why Do You Get the “pip not recognized” Error?

This error generally means that the system cannot find the pip executable. It’s usually caused by one of the following:

  1. Pip is not installed.
  2. Python Scripts path is not added to the system’s PATH environment variable.
  3. Python installation is broken or incomplete.

✅ Step 1: Check If pip Is Installed

First, check whether pip is installed on your system.

Open Command Prompt and run:

bash

python -m pip --version

If pip is installed, you’ll see something like:

sql

pip 24.0 from C:\Users\YourName\AppData\Local\Programs\Python\Python310\lib\site-packages\pip (python 3.10)

If you see this, pip is working, but your system just doesn’t recognize the pip shortcut command. Skip to Step 3.

If you get an error like No module named pip, then pip is not installed. Go to Step 2.


✅ Step 2: Install pip (if missing)

If pip is missing, reinstall it with the following:

  1. Download get-pip.py
  2. Open Command Prompt and navigate to the folder where get-pip.py is saved.
  3. Run:

bash

python get-pip.py

This installs pip and adds it to your Python directory.


✅ Step 3: Add pip to the Windows PATH

Even if pip is installed, Windows may not recognize it unless its location is added to the PATH environment variable.

🔹 Step-by-Step Guide:

  1. Press Win + S and search for “Environment Variables”.
  2. Click “Edit the system environment variables”.
  3. In the System Properties window, click Environment Variables.
  4. Under System Variables, find and select Path, then click Edit.
  5. Click New, and add the following paths (adjust based on your Python version and install location):

text

C:\Users\YourName\AppData\Local\Programs\Python\Python310\
C:\Users\YourName\AppData\Local\Programs\Python\Python310\Scripts\
  1. Click OK on all open windows to save changes.
  2. Restart Command Prompt and try running:

bash

pip --version

You should now see pip’s version info.


💡 Quick Tip: Find the Correct Path Automatically

If you’re unsure where Python is installed, run:

bash

where python

This will show the installation path. Then navigate to that folder and look for the Scripts subfolder. That’s where pip.exe lives.


🧪 Optional: Temporary Use Without Editing PATH

If you don’t want to edit environment variables, you can run pip like this:

bash

python -m pip install package_name

This method doesn’t require pip to be in your PATH, but you’ll have to use the longer command every time.


🔄 Still Not Working? Reinstall Python Completely

If all else fails:

  1. Uninstall Python via Settings > Apps.
  2. Download the latest version from the official Python website.
  3. During installation, make sure to check the box that says:

text

✔ Add Python to PATH

This will install both Python and pip and properly configure your system.


🧹 Pro Tip: Check Your Installation with These Commands

After fixing, use the following commands to test everything is working:

bash

python --version
pip --version
pip list

If all work, your Python and pip setup is clean.


✅ Summary
StepAction
1Check if pip is installed using python -m pip --version
2Install pip manually with get-pip.py if needed
3Add Python and Scripts folder to PATH
4Use python -m pip as a workaround
5Reinstall Python and ensure “Add to PATH” is checked


🔚 Final Thoughts

The 'pip' is not recognized as an internal or external command error might seem annoying at first, but it’s easy to fix once you know what’s happening under the hood.

By adding the correct folders to your system PATH and ensuring Python is properly installed, you’ll never have to deal with this issue again.

Have you encountered other Python installation issues? Share your experience in the comments or check out our other tutorials to smooth out your dev environment setup.