Python version priority in OSX/UNIX PATH environment variable

Posted by mindthief on Super User See other posts from Super User or by mindthief
Published on 2011-01-09T01:58:05Z Indexed on 2011/01/09 2:55 UTC
Read the original article Hit count: 464

Filed under:
|
|
|

Hi all, I want my system to use /usr/bin/python, but it's currently using /opt/local/bin/python, which points to /usr/bin/python2.6. I tried modifying the PATH variable in my .bashrc as

PATH=~/bin:$PATH

...and then set a symbolic link in ~/bin to point to /usr/bin/python. i.e. ~/bin/python --> /usr/bin/python

I figured this might prioritize this symlink over the /opt/local version if it came before the other one in the PATH variable, but when I opened a new shell I still found python pointing to /opt/local/bin. Any advice on a good way to get the system to use /usr/bin/python?

Also, I usually use ipython as opposed to python directly. I'm assuming that if the system starts to use the correct version of python then ipython would also use that version? If not, how could I also get ipython to use the correct version?

Thanks!

© Super User or respective owner

Related posts about osx

Related posts about unix