+1 vote
in Programming Languages by (6.7k 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

0 votes
by (12.7k points)
edited by

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

...