10

I tried to install pip several times but couldn't. This is how my terminal looks like while trying to install pip:

aman@aman-HP-Pavilion-Notebook:~$ sudo apt-get install python-pip

Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-pip is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

aman@aman-HP-Pavilion-Notebook:~$ pip

The program 'pip' is currently not installed. You can install it by typing:
sudo apt-get install python-pip

aman@aman-HP-Pavilion-Notebook:~$ sudo pip

sudo: pip: command not found

aman@aman-HP-Pavilion-Notebook:~$
Aman Kumar
  • 137
  • 1
  • 1
  • 8

2 Answers2

27

Try with this commands:

sudo apt-get purge --auto-remove python-pip

sudo apt-get update

sudo apt-get -y install python-pip

curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"

python get-pip.py

verify:

pip --help

pip -V

The issue might be package available in Ubuntu 14.04 Universe repository.

If that doesn't work, download the .deb from here:

https://packages.ubuntu.com/trusty/all/python-pip/download

and right click on the .deb and install it

developer_hatch
  • 15,898
  • 3
  • 42
  • 75
  • I have tried 10 times but couldn't able to resolve this. I have also tried install python3-pip but that also doesn't seem to work. – Aman Kumar Jun 01 '17 at 00:19
  • @AmanKumar okey then, check my updated answer, I think I know what is it – developer_hatch Jun 01 '17 at 00:27
  • **After trying `python get-pip.py` command I gets this :** `You are using pip version 1.5.4, however version 9.0.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. _aman@aman-HP-Pavilion-Notebook:~$_ pip --help The program 'pip' is currently not installed. You can install it by typing: sudo apt-get install python-pip _aman@aman-HP-Pavilion-Notebook:~$_ pip install --upgrade pip The program 'pip' is currently not installed. You can install it by typing: sudo apt-get install python-pip _aman@aman-HP-Pavilion-Notebook:~$_ ` – Aman Kumar Jun 01 '17 at 00:36
  • @AmanKumar I updated again. Try download the .deb and install it manually, it is indeed really rare... – developer_hatch Jun 01 '17 at 00:39
  • I tried that but it says **A later version is already installed**. I didn't able to uninstall pip because `pip uninstall pip` command is not working here. – Aman Kumar Jun 01 '17 at 00:42
  • do sudo apt-get purge --auto-remove python-pip @AmanKumar, and then follow the commands above – developer_hatch Jun 01 '17 at 00:45
  • @AmanKumar Fantaaaaaaaaaastic! don't forget to accept the answer with (✓) – developer_hatch Jun 01 '17 at 00:56
  • Worked like a charm! Thanks! – Taylor Liss May 10 '18 at 21:06
  • 1
    @TaylorLiss I have always loved to help – developer_hatch May 10 '18 at 22:53
  • 1
    Great solution! – C. Carley Jul 18 '18 at 09:52
1

the problem is probably you have two versions of python 2 installed on your PC in different locations and pip of one of the copies of python got removed somehow. so when you try to install the pip for a copy, system says that there is a pip already installed in another location and also the /usr/local/bin folder is also missing the pip file used to installed pip.

i just solved this issue so i will try to explain it in a way so that beginners also understand it properly

copy the already installed pip file to the location where it is missing instead of installing it through commands as command will detect the already installed pip.

the solution is very simple:

run these commands in a terminal (command prompt) in Ubuntu

which pip

# to get the location of the pip file already installed

cp location provided by which pip location where to copy pip file

hope it helps.

Khan
  • 1,288
  • 12
  • 11