Fix E: Unable to Locate Package Pip in Ubuntu

Fix E: Unable to Locate Package Pip in Ubuntu

  1. Update apt Repositories to Fix E: unable to locate package pip Error in Ubuntu
  2. Use python3-pip to Fix E: unable to locate package pip Error in Ubuntu
  3. Add the Universe Repository to Fix E: unable to locate package pip Error in Ubuntu

When installing Python pip on Ubuntu, sometimes you might get an error saying E: unable to locate package pip. It can occur if your apt repositories are not updated to the latest version or the system identifies the python-pip instead of the pip.

This tutorial will teach you to fix the error E: unable to locate package pip in Ubuntu.

Update apt Repositories to Fix E: unable to locate package pip Error in Ubuntu

Before installing any packages on Ubuntu, you must ensure the package repositories are updated to the latest versions. So when you install the package, it is fetched from the updated repositories.

Use the following command to update package repositories.

sudo apt update

Next, run this command to install the pip package.

sudo apt install pip

Use python3-pip to Fix E: unable to locate package pip Error in Ubuntu

Sometimes, the system cannot locate the pip package because the system only identifies the python-pip or python3-pip package. So you have to use python-pip or python3-pip instead of pip to install the pip package on Ubuntu.

For Python 2:

sudo apt install python-pip

For Python 3:

sudo apt install python3-pip

Add the Universe Repository to Fix E: unable to locate package pip Error in Ubuntu

You should try this method if you still cannot install the pip package.

First, add the universe repository using the command below.

sudo apt install software-properties-common
sudo apt-add-repository universe
sudo apt update

Next, install the pip package.

sudo apt install python-pip

Use python3-pip for Python 3.

After completing the installation, you can run the pip command. This command shows the version of pip installed in the system.

pip -V

Output:

pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)

Now you know how to install the pip package and fix the error E: unable to locate package pip in Ubuntu. We hope you find these solutions helpful.

Rohan Timalsina avatar Rohan Timalsina avatar

Rohan is a learner, problem solver, and web developer. He loves to write and share his understanding.

Related Article - Python Error

  • Python PermissionError: [WinError 5] Access Is Denied
  • Python TypeError: 'DataFrame' Object Is Not Callable
  • Python TypeError: Can't Convert 'List' Object to STR
  • Local Variable Referenced Before Assignment Error in Python
  • Python Handling Socket.Error: [Errno 104] Connection Reset by Peer
  • Python Is Not Recognized in Windows 10