SilverWebBuzz

Pip Command Not Found: Complete Fix Guide

Pip Command Not Found: Complete Fix Guide
Get in Touch With Us
Submitting the form below will ensure a prompt response from us.

    If you see the error pip command not found, it means your system cannot locate the pip executable — the package manager used to install and manage Python libraries. This error is common on macOS, Linux, and Windows when Python or pip is not installed correctly, or when your PATH environment variable is misconfigured.

    This guide gives step-by-step solutions for every major operating system, shell (bash, zsh), and case — including situations where pip is installed but still not recognized.

    What Causes pip command not found

    This error happens when your system cannot locate the pip executable. The most common causes include:
    • Missing pip installation – pip is not installed alongside Python or was removed.
    • Python not installed or not linked – your machine does not have Python installed, or the executable is not accessible from the shell.
    • PATH environment variable misconfigured – the directory containing pip is not in your system PATH, so the shell cannot find it.
    • Multiple Python versions – using both Python 2 and Python 3 can lead to mismatched commands (pip vs pip3 ).
    • Virtual environment issues – using a virtualenv or venv without activating it prevents pip from running.
    • Shell-specific issues – bash, zsh, or fish shells may not have updated PATH configurations after installing Python or pip.
    Identifying the cause helps apply the correct solution instead of trying random fixes.

    Quick Fix Checklist

    Follow these quick steps to resolve most cases of “pip command not found”:

    1. Verify Python installation

    Run:

    python3 –version

    or
    python –version

    If Python is missing, install it first.

    2. Check pip installation

    Run:

    python3 -m pip –version
    If this works, pip is installed but not linked globally.

    3. Install or upgrade pip

    python3 -m ensurepip –upgrade
    or
    python3 -m pip install –upgrade pip

    4. Add pip to PATH

    Make sure the directory containing pip (usually Scripts or bin ) is in your system PATH.

    5. Test pip

    Run:
    pip –version
    to confirm it works globally.

    Install or Reinstall Pip (Platform-Wise Solutions)

    macOS Fix

    If you’re on macOS and see “pip command not found,” follow these steps:

    1. Check Python installation

    macOS no longer includes Python 2 by default. Verify Python 3:
    python3 –version
    If missing, install Python 3 with Homebrew:
    brew install python

    2. Install or upgrade pip

    After installing Python 3, run:
    python3 -m ensurepip –upgrade
    or
    python3 -m pip install –upgrade pip

    3. Add pip to PATH (if needed)

    Locate pip:
    which pip3

    If no path is returned, add it manually. For example, if Homebrew installed Python here:

    export PATH=”/usr/local/opt/python/libexec/bin:$PATH”

    Add this line to your ~/.zshrc or ~/.bash_profile for persistence.

    4. Verify installation

    pip3 –version
    You should see a version number, confirming pip is ready to use.

    Linux Fix (Ubuntu/Debian/RedHat)

    On Linux, “pip command not found” usually means pip is not installed or not linked to the correct Python version.

    Step 1: Check Python Installation

    Run:
    python3 –version
    If Python 3 is missing, install it:
    • Debian/Ubuntu:
    sudo dnf install python3
    • RedHat/CentOS/Fedora:
    sudo dnf install python3

    Step 2: Install pip

    • Debian/Ubuntu:
    sudo apt install python3-pip
    • RedHat/CentOS/Fedora:
    sudo dnf install python3-pip

    Step 3: Add pip to PATH (if needed)

    Locate pip:
    which pip3
    If no path is returned, add the default Python bin directory to PATH:
    export PATH=”$HOME/.local/bin:$PATH”
    Add this line to ~/.bashrc or ~/.zshrc to make it permanent.

    Step 4: Verify Installation

    pip3 –version
    This should display the installed pip version.

    Windows Fix

    On Windows, “pip command not found” usually means either Python wasn’t installed with pip or the PATH variable is missing the Scripts folder.

    Step 1: Verify Python Installation

    Open Command Prompt and run:

    python –version
    If not recognized, download Python and during installation:
    • Check “Add Python to PATH”
    • Ensure “Install pip” is selected

    Step 2: Manually Add pip to PATH (If Needed)

    If Python works but pip does not:

    1. Find the Scripts folder (commonly):

    C:\Users\\AppData\Local\Programs\Python\Python311\Scripts

    2. Copy the folder path.

    3. Open Environment Variables → Edit PATH → Add the Scripts folder path.

    4. Close and reopen Command Prompt.

    Step 3: Reinstall or Upgrade pip

    Run:
    python -m ensurepip –upgrade
    or
    python -m pip install –upgrade pip

    Step 4: Test pip

    Run:
    pip –version
    You should see the pip version.

    python -m pip install –upgrade pip

    Tip:

    If pip still fails, try using:
    python -m pip install
    This works even if pip is not globally recognized.

    Shell-Specific Fixes (bash, zsh)

    If pip works in one shell but not another (for example, works in bash but not zsh), the issue is usually with the shell configuration files.

    Bash Fix

    1. Open ~/.bashrc or ~/.bash_profile.

    2. Add the pip path manually if missing:

    export PATH=”$HOME/.local/bin:$PATH”
    3. Reload the shell:
    source ~/.bashrc

    Zsh Fix

    1. Open ~/.zshrc.

    2. Add the same PATH line:

    export PATH=”$HOME/.local/bin:$PATH”

    3. Reload zsh:

    source ~/.zshrc
    Some shells cache commands. Run:

    Rehash After Installation

    hash -r
    to refresh available commands.
    After reloading, test:

    pip3 –version

    This ensures pip is recognized in your shell session.

    Fixing “pip Installed but Command Not Found”

    Sometimes pip is installed correctly but still not recognized globally. This usually happens because the executable is not symlinked or not in the PATH.

    Option 1: Use Python Module Form

    Run pip through Python directly:

    python3 -m pip –version

    or
    python -m pip –version
    This bypasses PATH issues and confirms pip works.

    Option 2: Locate and Link pip Manually

    1. Find where pip is installed:

    find $HOME -name “pip*” | grep bin
    or on Windows search for pip.exe in the Scripts folder.

    2. Create a symlink (Linux/macOS):

    sudo ln -s /usr/local/bin/pip3 /usr/bin/pip

    Option 3: Reinstall pip

    If the executable is missing or broken:

    python3 -m ensurepip –upgrade

    or

    python3 -m pip install –upgrade pip –force-reinstall
    After fixing, test again:
    pip –version

    Troubleshooting Advanced Issues

    If pip is installed but still fails or behaves inconsistently, check these advanced scenarios:

    1. Permission Denied Errors

    If you see errors like Permission denied or Operation not permitted while installing packages:
    • Use –user flag to install without admin rights:
    python3 -m pip install –user package_name
    • Or use sudo if installing system-wide (Linux/macOS):
    sudo python3 -m pip install package_name

    2. Multiple Python Environments

    When using pyenv, conda, or other version managers, each environment has its own pip.
    • Activate the correct environment:
    conda activate myenv
    or
    pyenv shell 3.11.5
    • Then use that environment’s pip:

    python -m pip install package_name

    3. Virtual Environment Not Activated

    If pip fails inside a project using venv or virtualenv:
    • Activate the environment:

    source venv/bin/activate

    (Windows: venv\Scripts\activate )

    Then reinstall or upgrade pip if needed:

    python -m ensurepip –upgrade

    4. Conflicting PATH Entries

    Sometimes multiple Python installations conflict.

    • Check PATH order:
    echo $PATH
    Ensure the correct Python installation appears first.

    Verify the Fix

    Once you’ve applied the fixes, confirm that pip is working:

    1. Check pip version:

    pip –version

    or

    pip3 –version
    You should see output with the pip version number and Python path.

    2. Test a package installation:

    pip install requests
    If installation succeeds without errors, pip is working correctly.

    3. Optional: Check that the package is installed:

    python -m pip show requests

    Successful output means the issue is fully resolved.

    Additional Resources

    For more details and best practices on installing, upgrading, and troubleshooting pip, refer to the official documentation: This ensures you always follow the recommended, secure methods for managing Python packages. 

    About Author

    Bhavik Koradiya is the CEO / Co. Founder of Silver WebBuzz Pvt. Ltd. Having 18+ years Experience in LAMP technology. I have expert in Magento, Joomla, WordPress, Opencart, e-commerce and many other open source. Specialties: Magento, WordPress, OpenCart, Joomla, JQuery, Any Open source.

    Related Q&A

    Scroll to Top