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:
Learn Python on Mimo
- Installed Python, but typing
pipfails in Terminal or PowerShell. - Use tooling that calls
pipdirectly, such as IDE tasks, scripts, or CI steps, and it breaks because PATH can’t findpip. - Have multiple Python installs and want a predictable default
pipfrom your terminal.
Skip PATH edits when:
python3 -m pipalready 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:
Bash
python3 -m pip --version
Windows:
Bash
py -m pip --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.exelives in aScriptsfolder. - macOS/Linux:
pipis often in the same folder aspython3, or already exists aspip3. Commands from--userinstalls go in a userbinfolder.
Windows: Find the Scripts folder for your Python
Print the path to the Python executable:
Bash
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
The pip command is often in the same folder as python3 (run which python3 to see it), or it’s available as pip3. If pip isn’t found, use python3 -m pip.
Your user-level bin folder holds commands from packages installed with --user, not necessarily pip itself. It’s your user base plus /bin.
Print your user base directory:
Bash
python3 -m site --user-base
Common results:
-
macOS:
/Users/you/Library/Python/3.12 -
Linux:
/home/you/.local
The user-level bin folder for --user installs 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.
- Open Start and search Environment Variables.
- Click Edit the system environment variables.
- Click Environment Variables…
- Under User variables, select Path, then click Edit.
- Click New and add your Python folder (the one that contains
python.exe). - Click New and add your
Scriptsfolder (the one that containspip.exe). - 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:
~/.zshrcfor zsh~/.bashrcfor bash
Example:
Bash
nano ~/.zshrc
If you need commands from --user installs on PATH, add the user-level bin folder from Step 2. This is not always where pip itself lives; python3 -m pip still works without this PATH edit.
Linux example:
Bash
export PATH="$HOME/.local/bin:$PATH"
macOS versioned example:
Bash
export PATH="$HOME/Library/Python/3.12/bin:$PATH"
Save, then reload:
Bash
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:
Bash
pip --version
python3 -m pip --version
Windows:
Bash
pip --version
py -m pip --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 python3 -m pip install ... on macOS/Linux 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:
Bash
py -m pip --version
Find Python’s location:
Bash
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:
Bash
python3 -m site --user-base
Add the bin folder to ~/.bashrc:
Bash
export PATH="$HOME/.local/bin:$PATH"
Reload and confirm the user bin folder is on PATH. Check pip with python3 -m pip --version, which works whether or not pip is in that folder:
Bash
source ~/.bashrc
python3 -m pip --version
Example 3: macOS, “not on PATH” warning during installs
Run an install that triggers the warning:
Bash
python3 -m pip install --user pipx
Add the folder shown in the warning to your PATH. Common pattern:
Bash
export PATH="$HOME/Library/Python/3.12/bin:$PATH"
Reload and verify:
Bash
source ~/.zshrc
pipx --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 and Linux: add the folder that contains
pip. It’s often the same folder aspython3(seewhich python3), orpipis already available aspip3.$HOME/Library/Python/3.12/bin(macOS) and$HOME/.local/bin(Linux) are for--userinstalls and may not containpip. If an installer printed a “not on PATH” warning, add the exact folder from that warning.
Reopen your terminal and re-check:
Bash
pip --version
Mistake 2: pip installs packages, then Python can’t import them
You might run:
Bash
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:
Bash
python3 -m pip install requests
python3 app.py
On Windows:
Bash
py -m pip install requests
py app.py
Troubleshooting
If you see: pip: command not found (macOS/Linux)
Use:
Bash
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:
Bash
python3 -m pip install --user requests
If you see: python3 works but points to a different version than expected
Check where it comes from:
Bash
which python3
python3 --version
If you see (Windows): confusion between python and py
Stick to the launcher for consistency:
Bash
py -m pip --version
py --version
Quick recap
- Check
pipthrough Python first withpython3 -m pip --versionorpy -m pip --version. - On Windows, add the
Scriptsfolder next to that Python. On macOS/Linux,python3 -m pipworks without a PATH edit; add abinfolder only when you need--usercommands or when an installer warning names that folder. - Add that folder to PATH and reopen your terminal.
- Verify
pip --versionandpython3 -m pip --version(orpy -m pip --version) point to the same install. - Use
python3 -m pip install ...on macOS/Linux orpy -m pip install ...on Windows when multiple Python installs exist.
Join 40M+ people learning for free on Mimo
4.8 out of 5 across 1M+ reviews
Check us out on Apple AppStore, Google Play Store, and Trustpilot