The pip command not found error means your shell cannot locate the pip executable, which is almost always a PATH problem or a Python installation that never included pip. The fastest fix is to run python -m pip --version (or python3 -m pip --version on macOS and Linux); if that works, pip is installed and you just need to call it through Python or add its folder to your PATH. If it fails, install pip with python -m ensurepip --upgrade or reinstall Python with pip included.

This guide covers Windows, macOS, and Linux. Menu labels and installer wording can differ slightly by version, device, and region, so match on meaning rather than exact text.

What You'll Need

  • A terminal or command prompt: Command Prompt or PowerShell on Windows, Terminal on macOS, or your shell on Linux.
  • Python installed (any recent 3.x version). Check with python --version or python3 --version.
  • Administrator or sudo rights if you need to install or reinstall Python system-wide.
  • An internet connection if pip must be downloaded or upgraded.

Step-by-Step

  1. Confirm Python itself works. Run python --version. On macOS and Linux, try python3 --version too. If neither command is recognized, Python is not installed or not on your PATH; fix that first, because pip ships with Python.
  2. Test pip through the Python module. Run python -m pip --version or python3 -m pip --version. If this prints a pip version and a Python path, pip exists. You can use python -m pip install package_name from now on, or continue to the next step to make the plain pip command work.
  3. Find where pip lives. Run python -m site --user-base to see your user install folder. On Windows, pip is usually in the Scripts subfolder of your Python install (for example, C:\Users\YourName\AppData\Local\Programs\Python\Python3xx\Scripts). On macOS and Linux it is often in ~/.local/bin or alongside the Python binary.
  4. Add that folder to your PATH. On Windows, open Settings and search for "Environment Variables," edit the Path variable under your user account, and add the Scripts folder. On macOS or Linux, add a line such as export PATH="$HOME/.local/bin:$PATH" to your shell profile (~/.zshrc or ~/.bashrc), then restart the terminal.
  5. Close and reopen the terminal. PATH changes do not apply to windows that are already open. Open a fresh terminal and run pip --version.
  6. If pip is genuinely missing, install it. Run python -m ensurepip --upgrade. If that is unavailable, download get-pip.py from the official pip website (pip.pypa.io) and run python get-pip.py. Only use the official source.
  7. If Python was installed without pip, reinstall Python. On Windows, run the official installer and make sure the "Add Python to PATH" option is checked on the first screen, and that pip is included in the optional features. On macOS, the python.org installer includes pip. On Linux, install the distro package (for example, python3-pip) with your package manager.
  8. Verify the fix. Run pip --version. It should print a version number and the Python path it belongs to. Then try pip install --upgrade pip to confirm it can reach the package index.

Common Mistakes

  • Typing pip when only pip3 exists. On many macOS and Linux systems the command is pip3. Try that before changing anything.
  • Editing the system PATH instead of the user PATH. On Windows, changing the system variable needs admin rights and affects every account; the user variable is safer.
  • Forgetting to reopen the terminal. A PATH edit looks like it did nothing until you start a new session.
  • Installing with sudo when not needed. On Linux, sudo pip install can break system packages. Prefer pip install --user or a virtual environment.
  • Mixing multiple Python installs. If you have Python from python.org, the Microsoft Store, and Anaconda, the pip on your PATH may belong to a different interpreter than the one running your code. Always check the path printed by pip --version.
  • Assuming pip is broken when the package name is wrong. A "command not found" error is about the command, not the package; do not chase package-name typos for this error.

Tips

  • Use python -m pip as your default habit. It always targets the interpreter you named, which avoids the wrong-pip problem entirely.
  • Work inside a virtual environment (python -m venv venv, then activate it) so installs stay isolated from the system Python.
  • On Windows, the py launcher can help: py -m pip --version picks the default installed Python.
  • Keep pip current with python -m pip install --upgrade pip; old pip versions can fail on newer package formats.
  • If you use a version manager or a store-installed Python, check that tool's documentation for where it puts scripts before editing PATH by hand.

Troubleshooting

If pip --version still fails after reopening the terminal, print your PATH (echo $PATH on macOS and Linux, echo %PATH% in Command Prompt, or $env:PATH in PowerShell) and confirm the folder you added actually appears. A common cause is a typo or a trailing backslash issue in the Windows entry.

If python -m pip works but plain pip does not, the PATH entry is the only problem; there is no need to reinstall anything. If python -m pip reports "No module named pip," pip is missing from that interpreter: run ensurepip, then reinstall Python if that fails.

If you get a permission error during install, do not reach for sudo first. Use pip install --user package_name or a virtual environment. On Windows, avoid running the terminal as administrator for routine installs.

If the command works in one terminal but not another, the shells are loading different profiles; check which startup file your shell reads and put the PATH line there. As a last resort, uninstall Python cleanly and reinstall from the official source, checking the PATH option during setup. Uninstalling removes installed packages, so note what you need to reinstall.

Frequently Asked Questions

Why does pip work as python -m pip but not as pip?

Because pip is installed but its folder is not on your PATH. Add the Scripts (Windows) or bin (macOS/Linux) folder to PATH, or keep using the module form.

Is pip installed automatically with Python?

Yes, current Python 3 installers from python.org include pip by default. Some Linux distributions and custom installs split it into a separate package.

Should I use pip or pip3?

Use whichever matches your Python command. If python3 is your interpreter, pip3 or python3 -m pip is the safe choice. The module form removes the ambiguity.

Can I fix this without admin rights?

Usually yes. Edit your user PATH, or install packages with --user or inside a virtual environment, which needs no elevated permissions.

Does reinstalling Python delete my packages?

A normal reinstall over the same version usually keeps site-packages, but a full uninstall and reinstall removes them. Back up or note your package list first.

Why does pip fail only inside my IDE's terminal?

The IDE may launch a shell that does not read your profile, or it may point at a different interpreter. Check the interpreter selected in the IDE and reopen its terminal after fixing PATH.