27

I had pip installed earlier on my OSX, but its not working somehow. So, i was trying to install pip again, using the command :

sudo easy_install pip

But it gives me the error as below :

pip 9.0.1 is already the active version in easy-install.pth
Installing pip script to /usr/local/bin
error: [Errno 2] No such file or directory: '/usr/local/bin/pip'

I am neither able to use pip, nor install it.

Sarang Manjrekar
  • 1,839
  • 5
  • 31
  • 61

6 Answers6

59

Just run:
$ hash -r
in bash and it will be solved.

mx0
  • 6,445
  • 12
  • 49
  • 54
Ebin Joseph
  • 622
  • 6
  • 2
  • 2
    THANK YOU THIS WORKED FOR ME March 2020 – lizziepika Mar 20 '20 at 21:32
  • 3
    There's no man page for this command, but it does work in some cases -- it updates the bash path hash, which sometimes gets stale under pyenv. https://www.computerhope.com/unix/bash/hash.htm – Autumn Jul 23 '21 at 23:07
51

In my case, I had to upgrade pip from 22.1.2 to 22.2.1:

pip3 install --upgrade pip
Yacine Rouizi
  • 1,360
  • 2
  • 15
  • 31
9

I solved it by removing the pip file in /usr/local/bin and reinstalling pip.

Mateen Ulhaq
  • 24,552
  • 19
  • 101
  • 135
1

Find your pip binary using this:

which pip or which pip3.7

then copy to below path:

sudo cp /home/LOGGED_USER/.local/bin/pip3.7 /usr/bin/pip3.7
anand babu
  • 335
  • 1
  • 3
  • 13
0

My solution to the "No such file or directory" error was to add to $PATH the directory, where the 'pip' (and 'pip3') commands are installed. In your case such directory might be '/usr/local/bin/pip'.

0

In my case I was using python3 pip but the working command was pip3

Turbolay
  • 88
  • 1
  • 10