typeoneerror
typeoneerror

Reputation: 56968

Start the correct python program via symbolic link

I recently installed ActivePython 2.7. So I've got a symbolic link in /usr/local/bin/python which points to the 2.7 directory. Trouble is, when I type "python" at the command line, it starts up MacPython 2.6 in /usr/bin/python. I don't understand why the symbolic link is not taking precedence. /usr/local/bin is on my PATH. Any help would be appreciated.

~ $ which python
/usr/bin/python

~ $ find /usr -iname python
/usr/bin/python
/usr/local/bin/python

Path looks like this:

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/opt/PalmPDK/bin:/opt/PalmSDK/Current/bin:/usr/X11/bin

Upvotes: 2

Views: 2308

Answers (2)

farmer_oak
farmer_oak

Reputation: 181

When you type “python” on the command line, the shell checks the values in your $PATH from left to right, and invokes the program it finds first. Check your current $PATH setting like this:

$ echo $PATH

If it contains both /usr/bin and /usr/local/bin then whichever comes first will take precedence.

Upvotes: 3

Santiago Alessandri
Santiago Alessandri

Reputation: 6855

in your PATH variable, /usr/bin probabbly is before the /usr/local/bin/ directory. you should use the full path in order to work in this case.

Upvotes: 2

Related Questions