11

What is a shorter way to do that:

wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py

?
I tried this:

sudo <(python <(curl https://bootstrap.pypa.io/get-pip.py))

but it returns the error: 'IOError: [Errno 32] Broken pipe'

This works: python <(curl https://bootstrap.pypa.io/get-pip.py) but requires sudo

kharandziuk
  • 12,020
  • 17
  • 63
  • 121

2 Answers2

16

curl https://bootstrap.pypa.io/get-pip.py | sudo python -

curl will output given URL to stdout

python - indicate, that source will be taken from stdin.

Zada Zorg
  • 2,778
  • 1
  • 21
  • 25
  • 2
    `-s` flag (silent) for `curl` should be helpful in case you plan to use that in some automation script or tool, so that it will not blame you with download progress. – Zada Zorg Dec 03 '14 at 17:21
3

Another way to install pip:

sudo python -m ensurepip

ThomasW
  • 16,981
  • 4
  • 79
  • 106