+3 votes
in Programming Languages by (73.8k points)

When I try to install any Python package using pip, it gives the following error: sudo: pip: command not found

I tried to install using sudo apt-get install pip, but i says: Unable to locate package pip
How to install pip?

1 Answer

+1 vote
by (349k points)
selected by
 
Best answer

You have to install python-pip instead of pip. Try the following command and it should work fine.

Python2

sudo apt-get install python-pip

Python3

sudo apt-get install python3-pip


...