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.

If this article helped, with someone on your team.

TecMint Weekly Newsletter
Get the Learn Linux 7 Days Crash Course free when you join 34,000+ Linux professionals reading every Thursday.
Check your email for a magic link to get started.
Something went wrong. Please try again.
TecMint has been free for 14 years. Help keep it that way.
Google AI Overviews and tools like ChatGPT have cut into search traffic for independent tech sites like TecMint. Running this site costs over $2,000 every month for hosting, infrastructure, and paying authors to keep the content accurate and tested.

If this article helped you solve a problem, consider buying a coffee. It helps keep TecMint free, supports the authors, and keeps the project going.
☕ Buy Me a Coffee
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.

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

Got Something to Say? Join the Discussion...

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.

Free Course
Get a free Linux course before you go.
Subscribe to TecMint Weekly and get the Learn Linux 7 Days Crash Course free. Read by 34,000+ Linux professionals every Thursday.
Something went wrong. Please try again.
Check your email for a magic link to get started.