I am unable to locate package python-pip:
Reading package lists... Done
Building dependency tree Reading state information... Done
E: Unable to locate package python3-pip
How can I resolve this problem?
I am unable to locate package python-pip:
Reading package lists... Done
Building dependency tree Reading state information... Done
E: Unable to locate package python3-pip
How can I resolve this problem?
For Ubuntu 18.04 (Bionic Beaver), with Python 3.6.5, the python-pip
package will install after:
sudo add-apt-repository universe
sudo apt-get update
Which is enabling the category universe
deb http://archive.ubuntu.com/ubuntu bionic main universe
deb http://archive.ubuntu.com/ubuntu bionic-security main universe
deb http://archive.ubuntu.com/ubuntu bionic-updates main universe
Following a clean install of Ubuntu 18.04 (via Vagrant), the following was installed successfully without any issues:
sudo apt-get update
sudo apt-get install -y python3-pip
Note that the Ubuntu 18.04 download today shipped with Python 3.6.8 installed. This may vary by the time of your reading this post.
First update and then install python3-pip. So the following two commands should work.
sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install python3-pip
First run sudo apt-get upgrade
. If you see ppa:some repository example launchpad.net not found or IP address not found then go to
Software & Updates, and then unmark the repositories causing the error. Then select the Ubuntu main server, and reload and run the commands
sudo apt-get update sudo apt-get autoremove sudo apt-get autoclean
it will delete unwanted existing packages and clear cache then
try
sudo apt-get update
sudo apt-get install -y python3-pip
These commands work for me:
sudo apt-get install python3-setuptools
sudo easy_install3 pip
This is the old way of installing pip and is especially useful for the old version of Ubuntu. But still it works fine for me.
You have to clear the unwanted repository's code /etc/apt/sources.list
or gedit /etc/apt/sources.list
. Or another option is switch Ubuntu mirror; see how to change ubuntu mirror
sudo apt-get update; sudo apt-get install python3-pip;
The other way is adding the universe category into the current sources.list file directly:
vi /etc/apt/sources.list
Then add the universe category at the end of each line:
deb http://archive.ubuntu.com/ubuntu bionic main universe
deb http://archive.ubuntu.com/ubuntu bionic-security main universe
deb http://archive.ubuntu.com/ubuntu bionic-updates main universe