Sometimes you get the error package python pip has no installation candidate in your Linux system. In this entire tutorial, you will know how to solve the error package python pip has no installation candidate in a very simple way.
Why the package python pip has no installation candidate Comes?
Most of the time Python pip has no installation candidate Comes when you are updating the version of Python. Suppose my Linux system has a python 2. xx version and I want to update the python3 version. To do so I will use the below lines of command.
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.8 20
The above command will install Python to the 3.8.20 version. You can check the current version of Python using the below bash command.
sudo python3 --version

But due to some corrupt modules of the python, you will get the package python-pip has no installation candidate error when you will try to install to the python3 pip module.
sudo apt install python3-pip
Output
E: Package 'python3-pip' has no installation candidate
Solution of the python pip has no installation candidate Error
In most cases this type of error comes when you forget to update the Linux repository databases. To solve this error you have to follow the three steps.
Step 1: Enable the universe repository
The first step is to enable the universe repository. To do so you have to run the below command.
sudo add-apt-repository universe
Step 2: Synchronize package database
The next step is to update the package database so that you will easily install the latest modules provided by the Linux database.
sudo apt update
Step 3: Install the pip3 module
After all the steps the last step is to install the pip3 module. Run the below command to install it.
sudo apt install python3-pip
That’s all you have to do to remove the python-pip has no installation candidate error. Please note that when you try to install any package in Linux then first update the Linux packages and then install any module.
The alternative of The Pip –
If you want to choose some other package manager for your project then you can use conda package manager or easy_install also. If you want to understand more about conda and its difference from pip please visit the below articles.
Difference Between Conda and Pip : 4 Major Differences
Python Anaconda Packages as One solution for all Data Science Problem
I hope you have liked this tutorial. If you have any queries then you can contact us for more help.
Specific For Python 2 only –
However, most of the developers use Python 3 these days. But if the legacy systems have python interpreter 2.x then run the below code.
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
python get-pip.py
I hope now we can easily fix up this error.
Thanks
Data Science Learner Team
Join our list
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.