Python – How to correct the path for pip

pathpippython

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
/usr/local/jdk/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin

# which python
/usr/local/bin/python

# which easy_install
/usr/local/bin/easy_install

# which pip
/usr/bin/pip

Best Answer

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
Related Question