9

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
  • 10,580
  • 11
  • 55
  • 108

2 Answers2

13

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,519
  • 1
  • 19
  • 24
  • 1
    `-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,483
  • 4
  • 76
  • 103