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:
python -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:
CSS
python3-m pip--version
Windows:
CSS
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.exelives in aScriptsfolder. - macOS/Linux:
pipoften lives in a userbinfolder, or already exists aspip3.
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.
- 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
Add the bin folder from Step 2.
Linux example:
Bash
exportPATH="$HOME/.local/bin:$PATH"
macOS versioned example:
Bash
exportPATH="$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:
CSS
pip--version
python3-m pip--version
Windows:
CSS
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:
CSS
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:
CSS
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:
Bash
exportPATH="$HOME/.local/bin:$PATH"
Reload and verify:
Bash
source ~/.bashrc
pip--version
Example 3: macOS, “not on PATH” warning during installs
Run an install that triggers the warning:
CSS
python3-m pip install--user pipx
Add the folder shown in the warning to your PATH. Common pattern:
Bash
exportPATH="$HOME/Library/Python/3.12/bin:$PATH"
Reload and verify:
Bash
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/binor the folder from the warning - Linux: add
$HOME/.local/bin
Reopen your terminal and re-check:
CSS
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:
CSS
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:
CSS
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:
CSS
py-mpip--version
py--version
Quick recap
- Check
pipthrough Python first withpython3 -m pip --versionorpy -m pip --version. - Find the folder that contains
pip(Scriptson Windows, abinfolder on macOS/Linux). - Add that folder to PATH and reopen your terminal.
- Verify
pip --versionandpython -m pip --versionpoint to the same install. - Use
python -m pip install ...when multiple Python installs exist.
Join 35M+ 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