Curl and run python script

What is the shorter way to do this:

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 an error: 'IOError: [Errno 32] Broken pipe'

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

+5
source share
2 answers

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

curl prints the given url to stdout

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

+7
source

Another way to install pip:

sudo python -m ensurepip

+1
source

Source: https://habr.com/ru/post/1208244/


All Articles