Last modified: Oct 01, 2026

Fix "pip: command not found" on Linux

You just tried to install a Python package. You typed pip install requests. Then the terminal replied with pip: command not found.

This error is common on Linux. It happens for a few simple reasons. The good news is that the fix is easy.

In this guide, you will learn why this error appears. You will also learn how to fix it step by step. The steps work on Ubuntu, Debian, Fedora, CentOS, and Arch.

What Does "pip: command not found" Mean?

This error means your shell cannot find the pip program. The shell looks for commands in folders listed in your PATH. If pip is not in one of those folders, the shell gives up.

There are three main causes:

1. pip is not installed on your system.

2. pip is installed, but only as pip3 or python3-pip.

3. pip is installed, but its folder is not in your PATH.

Let us fix each cause one by one.

Step 1: Check If pip Is Really Missing

Before you install anything, check what you have. Run these commands in your terminal:


pip --version
pip3 --version
python3 -m pip --version

You may see output like this:


$ pip --version
pip: command not found

$ pip3 --version
pip 24.0 from /usr/lib/python3/dist-packages/pip (python 3.12)

$ python3 -m pip --version
pip 24.0 from /usr/lib/python3/dist-packages/pip (python 3.12)

If pip3 works, then pip is installed. You just need to use pip3 instead of pip. That is the fastest fix.

If nothing works, pip is missing. Move to Step 2.

Step 2: Install pip on Ubuntu or Debian

On Ubuntu and Debian, pip comes from the python3-pip package. Update your package list first. Then install pip.


# Update the package index
sudo apt update

# Install pip for Python 3
sudo apt install python3-pip

# Verify the installation
pip3 --version

Expected output:


Reading package lists... Done
Building dependency tree... Done
The following NEW packages will be installed:
  python3-pip
...
Setting up python3-pip (24.0+dfsg-1ubuntu1) ...
$ pip3 --version
pip 24.0 from /usr/lib/python3/dist-packages/pip (python 3.12)

Now try pip3 install requests. It should work.

Step 3: Install pip on Fedora, CentOS, or RHEL

On Red Hat based systems, the package name is python3-pip as well. Use dnf on Fedora and newer CentOS. Use yum on older systems.


# Fedora and CentOS Stream
sudo dnf install python3-pip

# Older CentOS or RHEL
sudo yum install python3-pip

# Check the version
pip3 --version

Output:


Installed:
  python3-pip-24.0-1.fc39.noarch
Complete!
$ pip3 --version
pip 24.0 from /usr/lib/python3.12/site-packages/pip (python 3.12)

Step 4: Install pip on Arch Linux

Arch users can install pip from the official repositories. The package is called python-pip.


# Install pip for the default Python
sudo pacman -S python-pip

# Verify
pip --version

Output:


resolving dependencies...
looking for conflicting packages...
Packages (1) python-pip-24.0-1
$ pip --version
pip 24.0 from /usr/lib/python3.12/site-packages/pip (python 3.12)

Step 5: Use ensurepip as a Backup

Sometimes you cannot use a package manager. In that case, Python ships with a built-in tool called ensurepip. It installs pip for you.


# Install pip using the Python module
python3 -m ensurepip --upgrade

# Check the result
python3 -m pip --version

Output:


Looking in links: /usr/share/python-wheels
Requirement already satisfied: pip in /usr/lib/python3.12/site-packages
$ python3 -m pip --version
pip 24.0 from /usr/lib/python3.12/site-packages/pip (python 3.12)

This method is safe. It does not touch system packages. It only installs pip inside your Python environment.

Step 6: Fix the PATH Problem

Maybe pip is installed, but your shell cannot find it. This happens when pip lives in a folder that is not in your PATH.

First, find where pip is:


# Locate the pip binary
find / -name "pip3" -type f 2>/dev/null

Example output:


/home/youruser/.local/bin/pip3

Now check your PATH:


echo $PATH

If /home/youruser/.local/bin is missing, add it. Open your shell config file:


# For bash users
nano ~/.bashrc

# For zsh users
nano ~/.zshrc

Add this line at the end of the file:


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

Save the file. Then reload it:


source ~/.bashrc

Now run pip3 --version again. It should work.

Step 7: Create an Alias for pip

If you want to type pip instead of pip3, create an alias. This is a quick and clean solution.


# Add alias to your shell config
echo "alias pip='pip3'" >> ~/.bashrc
source ~/.bashrc

# Test it
pip --version

Output:


pip 24.0 from /usr/lib/python3/dist-packages/pip (python 3.12)

This keeps your system clean. It also saves you typing time.

Step 8: Use a Virtual Environment Instead

Many Linux systems now block system-wide pip installs. This is a safety feature. The best practice is to use a virtual environment.


# Create a virtual environment
python3 -m venv myenv

# Activate it
source myenv/bin/activate

# pip is now available inside the environment
pip install requests

Output:


Collecting requests
  Downloading requests-2.31.0-py3-none-any.whl (62 kB)
Installing collected packages: requests
Successfully installed requests-2.31.0

Inside a virtual environment, pip always works. It also keeps your project dependencies separate from the system.

Common Mistakes to Avoid

Do not use sudo pip install on modern systems. It can break your OS packages. Use a virtual environment or the --user flag instead.

Do not mix pip and pip3 blindly. They may point to different Python versions. Always check with pip --version.

Do not forget to update pip. An old pip can cause strange errors later.


# Update pip safely
python3 -m pip install --upgrade pip

Quick Troubleshooting Checklist

If you still see the error, run through this list:

1. Run pip3 --version. Does it work?

2. Run python3 -m pip --version. Does it work?

3. Check your PATH with echo $PATH.

4. Reinstall pip with your package manager.

5. Try python3 -m ensurepip --upgrade.

6. Use a virtual environment for your project.

One of these steps will solve the problem.

Conclusion

The pip: command not found error on Linux is not scary. It usually means pip is missing or hidden behind the name pip3.

Start by checking pip3 --version. If that works, just use pip3 or create an alias. If it fails, install pip with apt, dnf, yum, or pacman. If pip exists but is not found, fix your PATH.

For daily work, always prefer a virtual environment. It keeps your system safe and your projects clean. Follow the steps above, and you will never be stuck on this error again.