No such file or directory: '/usr/local/bin/pip'

Question:

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.

Asked By: Sarang Manjrekar

||

Answers:

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

Answered By: Irsyad Mhd Ilham

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

Answered By: Ebin Joseph

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’.

Answered By: StudentAtLU

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

pip3 install --upgrade pip
Answered By: Yacine Rouizi

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
Answered By: anand babu

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

Answered By: Turbolay
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.