How to fix "'pip' is not recognized as an internal or external command"
Researched, not yet tested: compiled from the Python documentation for Windows (Python 3.15) as of 29 November 2026; the python -m pip commands were checked on Linux, not on a Windows PC. Check the commands against your setup.
Run pip through Python instead. It works without any PATH changes:
py -m pip install requests
or python -m pip install requests if python works on your machine. Python’s Windows documentation recommends python -m pip when the pip command isn’t found. To get the plain pip command working too, see the fixes below.
We didn’t test on a Windows PC. The steps come from the Python documentation for Windows. We checked the -m pip and ensurepip commands on Linux, where they behave the same way.
Why pip isn’t found
The message looks like this in Command Prompt:
'pip' is not recognized as an internal or external command,
operable program or batch file.
PowerShell says The term 'pip' is not recognized as the name of a cmdlet... instead. Either way, pip.exe sits in a Scripts folder that isn’t on your PATH. That happens when:
- Python was installed without adding it to PATH.
- You installed pip into a virtual environment and haven’t activated it in this window.
- You use the Python install manager and the global shortcut for pip hasn’t been created or isn’t on PATH.
If python itself isn’t recognized either, fix that first: see python is not recognized.
Fix 1: use a virtual environment
This is what the Python docs recommend for project work. Inside an activated environment, pip always works:
py -m venv .venv
.venv\Scripts\activate
pip install requests
In PowerShell the activate step is .venv\Scripts\Activate.ps1. When we made a venv on Linux, its bin folder (Scripts on Windows) held pip and python.
Fix 2: refresh the install manager’s shortcuts
The Python docs’ troubleshooting table says that with the Python install manager, running this command and making sure the global shortcuts folder is on PATH should make pip available. The command’s output names the folder if it’s missing from PATH:
py install --refresh
Fix 3: add the Scripts folder to PATH
For Python from the older full installer, find where Python lives:
py -c "import sys, os; print(os.path.join(sys.prefix, 'Scripts'))"
Add the folder it prints to PATH: search Start for “Edit environment variables for your account”, select Path, click Edit, then New, paste the folder and click OK. Open a new terminal and run pip --version.
If pip itself is missing
If py -m pip says No module named pip, Python was installed without pip. Add it with:
py -m ensurepip --upgrade
Our page on no module named pip covers this case, including environments where ensurepip is unavailable.
A package’s command isn’t found after pip install
The same PATH problem applies to commands that packages install, such as black or pytest. Python’s docs give the same answers: activate the virtual environment, or run the tool as a module (py -m pytest). For tools you want available everywhere, pipx installs each one in its own environment, and pipx ensurepath adds its commands folder to PATH.
FAQ
How do I install pip in CMD?
pip usually comes with Python, so you rarely need to install it. Try py -m pip --version first. If it says there's no module named pip, run py -m ensurepip --upgrade to add it, then use py -m pip install <package>.
Why is my terminal not recognizing pip?
The pip command lives in a Scripts folder that isn't on your PATH, or you haven't activated the virtual environment it's in. Running pip through Python (py -m pip or python -m pip) avoids PATH completely.
How do I enable pip in the terminal?
Activate a virtual environment (.venv\Scripts\activate), which puts its pip on PATH for that window. To use pip globally, add Python's Scripts folder to PATH under "Edit environment variables for your account", then open a new terminal.
Is python -m pip the same as pip?
It runs the same pip, but always the one that belongs to the Python you named. That's why Python's own docs recommend it: with several Python versions installed, plain pip can install packages into a different one.
