10
$ sudo apt-get install python-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package python-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  python3-pip

both my pip and pip3 are installed in python 3

pip -V
pip 20.1.1 from /usr/lib/python3/dist-packages/pip (python 3.8)


pip3 -V
pip 20.1.1 from /usr/lib/python3/dist-packages/pip (python 3.8)

Now i cant install pip ...it shows above error

daniel lugo
  • 117
  • 1
  • 1
  • 8

3 Answers3

30

If you have python(python2) installed you then you can use following command to install pip(for python2).

curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
python get-pip.py

Now you can check for pip2

pip2 --version

I hope these will help you

Abrar Jahin
  • 13,156
  • 22
  • 105
  • 151
Shingala_Yagnik
  • 332
  • 2
  • 4
  • 2
    For users coming back to this python2.7 requires you use a specific version of get-pip: https://bootstrap.pypa.io/pip/2.7/get-pip.py – jimbob88 Apr 17 '21 at 16:55
0

Just for reference, this problem can occur if you are using Windows Ubuntu Shell and your firewall is blocking your Ubuntu sandbox's traffic. In that case installation resources can not be found and simple apt-update will not work.

In order to test if the firwall causes your problem, you can simply try to ping a website. Also if apt-update will fail with connection refused the firwall is likely your problem. Check this post on how to add your sandbox to the firewall whitelist (Endpoint Protection).

DataBach
  • 941
  • 1
  • 11
  • 23
-6

Use these commands first then try again and perform a reinstallation by sudo apt reinstall python3-pip

  1. sudo add-apt-repository universe
  2. sudo add-apt-repository multiverse
  3. sudo apt-get update
Tomerikoo
  • 15,737
  • 15
  • 35
  • 52