I'm trying to get pip to point to a different install rather than the default. It is currently pointing to /usr/bin/pip, but I want it to point to /usr/local/bin/pip. I believe I have the path set correctly and everything else points to the correct location.

What's the best way to resolve this?

# echo $PATH

# which python

# which easy_install

# which pip
  • 2
    Does /usr/local/bin/pip exist and is it executable for your user?
    – HBruijn
    Feb 27, 2015 at 5:04
  • What does which -a pip output?
    – Bandrami
    Feb 27, 2015 at 5:58
  • /usr/local/bin/pip does exist for users. # which -a pip /usr/local/bin/pip /usr/bin/pip /usr/local/bin/pip
    – Andrew Saxe
    Feb 27, 2015 at 18:16

5 Answers 5


Using 'alias' is another possible option. Just put it into the relevant shell configuration file (for execution each time your shell is executed).

$ alias pip='/usr/bin/pip'
$ alias pip
alias pip='/usr/bin/pip'
$ alias pip='/usr/local/bin/pip'
$ alias pip
alias pip='/usr/local/bin/pip'
$ pip
bash: /usr/local/bin/pip: No such file or directory

It seems that you have both pip installed via easy_install and OS package manager. If you want to use only one, just remove another one.

In your case, you want pip from easy_install, so just removing which one from OS package manager.

With Debian/Ubuntu:

sudo apt-get purge python-pip

With Redhat/Centos/Fedora:

sudo yum remove python-pip

You can specify PATH to local pip in ~/.bash_profile file. Supposed that you you would like to use pip from /usr/local/bin/pip, you can add export PATH=$HOME/usr/local/bin:$PATH to the file. This will add the desired PATH to existing PATH ($PATH).

Then, source ~/.bash_profile to update the PATH.

Check pippath again by typing which pip.


Nobody mentioned this here but a symlink would do the trick as well. In my case since /usr/bin is the default path for every program, just make the pip symlink point to the correct pip executable.

  • But in my case I already have a pip executable in /usr/bin, so can I just delete it and replace with simlink? Mar 26, 2021 at 9:43

Edit your ~/.bashrc file to include the path to your preferred pip installation. E.g.

alias pip='/usr/bin/pip'

Then source your .bashrc file for it to come into action.

source ~/.bashrc

Check: which pip


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy