How to Add Python Pip to PATH

What you’ll build or solve

You’ll fix the “pip not found” problem by making pip available as a terminal command.

When this approach works best

This approach works well when you:

  • Installed Python, but typing pip fails in Terminal or PowerShell.
  • Use tooling that calls pip directly, such as IDE tasks, scripts, or CI steps, and it breaks because PATH can’t find pip.
  • Have multiple Python installs and want a predictable default pip from your terminal.

Skip PATH edits when:

  • python -m pip already works and you’re fine using that form. It avoids most “wrong pip” problems.

Prerequisites

  • Python installed
  • A terminal
    • macOS/Linux: Terminal
    • Windows: PowerShell or Windows Terminal
  • Permission to edit environment variables (Windows) or your shell config file (macOS/Linux)

Step-by-step instructions

1) Confirm Python works and check pip through Python

Start with the most reliable check. This confirms pip exists even if PATH is broken.

macOS/Linux:

python3-m pip--version

Windows:

py-mpip--version

What to look for

You should see a pip version and a site-packages path.

If this fails, Python or pip is not installed correctly. Jump to Troubleshooting.


2) Identify the folder you need to add to PATH

You want the folder that contains the pip executable.

  • Windows: pip.exe lives in a Scripts folder.
  • macOS/Linux: pip often lives in a user bin folder, or already exists as pip3.

Windows: Find the Scripts folder for your Python

Print the path to the Python executable:

py-c"import sys; print(sys.executable)"

If this prints something like:

C:\Users\You\AppData\Local\Programs\Python\Python312\python.exe

Then the folder you want to add is usually:

C:\Users\You\AppData\Local\Programs\Python\Python312\Scripts\

macOS/Linux: Check your user-level bin folder

Print your user base directory:

python3-m site--user-base

Common results:

  • macOS:

    /Users/you/Library/Python/3.12

  • Linux:

    /home/you/.local

The folder you typically add to PATH is:

  • macOS:

    /Users/you/Library/Python/3.12/bin

  • Linux:

    /home/you/.local/bin

What to look for

If you previously saw a warning like:

installed in ... which is not on PATH

Add the exact folder shown in that warning.


3) Add that folder to PATH

Windows: Add Python and Scripts to PATH

Add both the Python folder and the Scripts folder so python and pip work from anywhere.

  1. Open Start and search Environment Variables.
  2. Click Edit the system environment variables.
  3. Click Environment Variables…
  4. Under User variables, select Path, then click Edit.
  5. Click New and add your Python folder (the one that contains python.exe).
  6. Click New and add your Scripts folder (the one that contains pip.exe).
  7. Click OK on all dialogs.

Example paths (yours may differ):

C:\Users\You\AppData\Local\Programs\Python\Python312\
C:\Users\You\AppData\Local\Programs\Python\Python312\Scripts\

What to look for

Reopen PowerShell. Old terminals keep the old PATH.


macOS/Linux: Add your bin folder to your shell config

Edit your shell config:

  • ~/.zshrc for zsh
  • ~/.bashrc for bash

Example:

nano ~/.zshrc

Add the bin folder from Step 2.

Linux example:

exportPATH="$HOME/.local/bin:$PATH"

macOS versioned example:

exportPATH="$HOME/Library/Python/3.12/bin:$PATH"

Save, then reload:

source ~/.zshrc

What to look for

If pip still doesn’t exist but pip3 does, your system may expose pip3 by default. python3 -m pip still works reliably.


4) Verify pip works and matches your Python

Close and reopen your terminal, then run:

macOS/Linux:

pip--version
python3-m pip--version

Windows:

pip--version
py-mpip--version

If both point to the same install, you’re done.

What to look for

If pip --version and python3 -m pip --version (or py -m pip --version) show different locations, PATH is pointing at a different Python install. Use the Common mistakes section to fix it.

Tip: Use python -m pip install ... or py -m pip install ... on Windows when you suspect multiple Python installs. It installs into the interpreter you’re running.


Examples you can copy

Example 1: Windows, pip not recognized

Confirm pip exists:

py-mpip--version

Find Python’s location:

py-c"import sys; print(sys.executable)"

Add the matching Scripts folder to PATH, reopen PowerShell, then verify:

pip--version

Example 2: Linux, user bin folder missing from PATH

Check your user base:

python3-m site--user-base

Add the bin folder to ~/.bashrc:

exportPATH="$HOME/.local/bin:$PATH"

Reload and verify:

source ~/.bashrc
pip--version

Example 3: macOS, “not on PATH” warning during installs

Run an install that triggers the warning:

python3-m pip install--user pipx

Add the folder shown in the warning to your PATH. Common pattern:

exportPATH="$HOME/Library/Python/3.12/bin:$PATH"

Reload and verify:

source ~/.zshrc
pip--version

Common mistakes and how to fix them

Mistake 1: Adding the wrong folder to PATH

What you might do

Add the Python folder, but not the folder that contains pip.

Why it breaks

pip usually lives in Scripts (Windows) or a bin directory (macOS/Linux).

Fix

Add the folder that actually contains the pip executable:

  • Windows: add ...\Python312\Scripts\
  • macOS: add $HOME/Library/Python/3.12/bin or the folder from the warning
  • Linux: add $HOME/.local/bin

Reopen your terminal and re-check:

pip--version

Mistake 2: pip installs packages, then Python can’t import them

You might run:

pip install requests
python3 app.py

…and see ModuleNotFoundError.

Why it breaks

pip points to one Python install, but python3 points to another.

Fix

Install with the interpreter you run:

python3-m pip install requests
python3 app.py

On Windows:

py-mpipinstallrequests
pyapp.py

Troubleshooting

If you see: pip: command not found (macOS/Linux)

Use:

python3-m pip--version

Then add the correct bin folder to PATH.


If you see (Windows): pip is not recognized as the name of a cmdlet

Add the Scripts folder to PATH, then reopen PowerShell.


If you see:

WARNING: The script ... is installed in ... which is not on PATH

Add that exact folder to PATH. The message tells you the correct directory.


If you see: PermissionError or installs fail outside a venv

Use a virtual environment, or install with --user:

python3-m pip install--user requests

If you see: python3 works but points to a different version than expected

Check where it comes from:

which python3
python3--version

If you see (Windows): confusion between python and py

Stick to the launcher for consistency:

py-mpip--version
py--version

Quick recap

  • Check pip through Python first with python3 -m pip --version or py -m pip --version.
  • Find the folder that contains pip (Scripts on Windows, a bin folder on macOS/Linux).
  • Add that folder to PATH and reopen your terminal.
  • Verify pip --version and python -m pip --version point to the same install.
  • Use python -m pip install ... when multiple Python installs exist.