Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am using Google App Engine but starting programs from its interface is not working.
The logs in GAE indicate it is trying to use python 2.6 and it needs 2.7 so it fails to run.
I have used python 2.7 before and when I type 'python' from any path in a terminal, the 2.7 banner comes up.
However, if I invoke '/usr/bin/python' I get the 2.6 banner.
Even if I am in '/usr/bin' and I type 'python' I get the 2.7 banner.
My env variables mention plenty of stuff about 2.7.
I tried changing the path to python in GAE from '/usr/bin/python' to 'python' which did not work.
What am I missing?
EDIT:
It seems that user related path is superseded by system wide path (guessing).
/etc/path contains only /usr/bin, /bin, /usr/sbin, /sbin, /usr/local/bin (in that order)
my path under env contains much more things that have been added over time, but it seems that the very first thing that is looked at is /etc/path, which is taking precedence over /usr/bin/env
EDIT:
The root of the problem turned out to be OSX relying on outdated python libraries that don't install to the same place as new python installers, it is easy to mess up your system messing with the old python 2.5 and 2.6 stuff on osx snow leopard. I ended up linking /usr/bin/python to /Library/Frameworks/Python.framework/Versions/2.7/bin/python, works so far but I could see this messing something up so read more before you use this.

share|improve this question
1  
What does this have to do with OS X? In any case, what did you change when you tried to fix it? What does an ls -l /usr/bin/python show? How about which python? –  ernie Dec 13 '13 at 21:08
    
@ernie: probably not much to do with osx now but when it was originally installed it was without installer and took quite a bit more effort to get working. Which python = /Library/Frameworks/Python.framework/Versions/2.7/bin/python and ls -l = -rwxr-xr-x 2 root wheel 86000 –  fightermagethief Dec 13 '13 at 21:18
1  
@bboyreason ls -l /usr/bin/python should output something like -rwxr-xr-x 1 root wheel 9 Sep 14 01:15 /usr/bin/python -> python2.7 if it's a symlink, yours is a hardlink(note 2) also try ls -l $(which python) –  behrooz Dec 13 '13 at 21:39
    
@behrooz that gets lrwxr-xr-x 1 root admin /Library/Frameworks/Python.framework/Versions/2.7/bin/python -> python2 python2 calls 2.7 –  fightermagethief Dec 13 '13 at 22:00
1  
They are symlinked to each other, try reverting what you did. The only thing that may help now is seeing the full PATH that GAE sees, if there is anyway to extract it. –  behrooz Dec 13 '13 at 22:09

1 Answer 1

In Linux we have this thing called Alternatives system that handles these situations. I'd check if the python binary is a symlink to another python or not, and change it to the one I want if so.
Also check if your PATH contains ".", and if it does, try removing it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.