How to Fix “Command ‘pip3’ not found” Error in Linux

PIP is the conventional package manager for Python, which is the standard tool for installing and managing Python packages alongside their dependencies which are not included in the standard Python library.

When using pip, you might encounter the error “pip command not found” on the terminal. Below is an excerpt of the error as captured on the Ubuntu system.

$ pip3 install pandas

Command 'pip3' not found, but can be installed with:
sudo apt install python3-pip

From the output, you can infer that there’s a high chance that PIP is not installed.

In this article, we look at ways how you can install PIP in Linux to fix the “pip command not found” error.

Install PIP in Linux

The first course of action is to ensure that Python is installed on the system, which you can confirm by running:

$ python3 --version

Python 3.9.2

From the output, we already have Python 3.9 installed.

To install PIP on Debian-based distributions, run the following command:

$ sudo apt install python3-pip -y

The command installs PIP alongside a bunch of other additional packages and dependencies.

Install PIP in Debian-based Systems
Install PIP in Debian-based Systems

For RHEL-based distributions such as Fedora, Rocky, AlmaLinux, and CentOS run the following yum command.

$ sudo yum install python3-pip -y

For Arch Linux distributions, execute the command:

$ sudo pacman -S python-pip -y

Once installed, verify the version of the pip installed as shown.

$ pip3 --version

pip 20.3.4 from /usr/lib/python3/dist-packages/pip (python 3.9)

Additionally, you can verify the location of pip binaries as shown

$ which pip3

/usr/bin/pip3

From the output, we have installed PIP 20.3.4.

Upgrade PIP in Linux

The other way to fix the “pip command not found” error is to upgrade PIP to the latest version.

$ sudo -H pip3 install --upgrade pip
Upgrade PIP in Linux
Upgrade PIP in Linux

From the output, we have upgraded the pip from version 20.3.4 to 23.1.2.

PIP – Install Python Packages

Now you should be able to install and manage Python packages and libraries using Pip without an issue.

For example, you can install Pandas as shown.

$ pip3 install pandas
Install Python Pandas in Linux
Install Python Pandas in Linux

In this article, we have successfully resolved the error “pip command not found”. I hope you found this article informative.

Winnie Ondara
My name is Winnie, a Linux enthusiast and passionate tech writer in Linux and DevOPs topics. I enjoy keeping abreast with the latest technologies in the Linux ecosystem and trying out new tools provided by the FOSS community.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

1 Comment

Leave a Reply
  1. Hi,

    At least some time ago it was not advisable to install pip from the distro’s repo because very often it was an outdated version and, most important, it was not advisable to upgrade it using pip because it was using some different paths.

    At least that was the case with some Debian and or Ubuntu (older) versions. Maybe things changed with the pip3 and/or newer versions of python-pip packages.

    Reply

Leave a Reply to Lohmar Ashar Cancel reply

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.