'pip' is not recognized as an internal or external command
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
On Windows, the message saying pip is not recognized means the shell cannot find the executable for the Python installation you expect. The fastest fix is usually to run python -m pip first, then repair PATH or the Python install only if that command fails.
Start with python -m pip
Before changing environment variables, confirm that Python itself is available:
If both commands work, then pip is installed and the problem is only command lookup. You can keep working immediately with:
This is also the safest form in environments with several Python versions because it binds the package install to the interpreter named by python.
Find the Scripts directory
If python works but bare pip does not, ask Python where its scripts are stored:
Typical output looks like this:
That Scripts directory usually contains pip.exe.
Add Python and Scripts to PATH
To make the standalone pip command work, Windows normally needs both the Python directory and the Scripts directory on PATH:
After updating PATH, close the terminal, open a new one, and test again:
Reopening the terminal matters because an existing shell usually does not reload environment variables automatically. This detail is easy to miss and causes a lot of false negatives during troubleshooting.
Repair pip if it is missing
If python -m pip --version fails even though python works, repair or install pip with ensurepip:
If python itself is not recognized, the problem is broader than pip. In that case, repair or reinstall Python and make sure the installer option to add Python to PATH is enabled.
If python is missing too
Sometimes the message about pip is only the symptom and the real issue is that Python is not installed correctly or is not on PATH at all. In that case, fix Python discovery first and only then return to pip:
These commands quickly show whether Windows can find the interpreter or whether you are dealing with a broader installation problem.
Virtual environments and multiple interpreters
Many Windows machines have several Python interpreters, including python.org installs, Microsoft Store builds, Conda, and IDE-managed environments. That is why python -m pip is more reliable than bare pip.
If you are using a virtual environment, activate it first:
Or call the environment interpreter directly:
The Windows launcher can help too:
Those commands are useful when python and pip point at different interpreters and you need to make the selection explicit. They also help when python is not mapped the way you expect in a specific terminal profile.
Common Pitfalls
- Fixing
PATHfor one Python installation while the shell is using another interpreter. - Editing environment variables and then testing again in the same terminal window.
- Running bare
pipin a multi-environment setup and installing packages into the wrong Python. - Assuming
pipis broken when Python itself is missing or not onPATH.
Summary
- Try
python -m pipfirst because it avoids most command-resolution issues. - Add the Python directory and the
Scriptsdirectory toPATHif you want barepipto work. - Use
ensurepipwhen Python exists butpipis missing or damaged. - Prefer interpreter-specific commands in virtual environments and multi-Python setups.

