views:

28

answers:

1

When I type which python, I get the following result:

/Library/Frameworks/Python.framework/Versions/Current/bin/python

when I type "type -a python":

python is /Library/Frameworks/Python.framework/Versions/Current/bin/python python is /Library/Frameworks/Python.framework/Versions/2.6/bin/python python is /Library/Frameworks/Python.framework/Versions/2.7/bin/python python is /Library/Frameworks/Python.framework/Versions/Current/bin/python python is /usr/bin/python python is /usr/local/bin/python

I want to use python 2.5, which I have installed!

But at this point, I'm a bit confused, and I don't know how to set that as default, or what path I should be using.

Please note, I am developing SPECIFICALLY for Google App Engine, so please keep that in mind.

Thanks in advance.

+2  A: 

If you install Python 2.5 from python.org (specifically this dmg file), it can make a link for you into /usr/local/bin/python. Once you do that, and ensure /usr/local/bin is in your $PATH environment variable, then /usr/local/bin/python should be exactly what you want. To verify, try at a Terminal.app shell prompt...:

$ python -V
Python 2.5.4

this should confirm that 2.5.4 is the default Python. Also:

$ /usr/bin/env python -V

(since /usr/bin/env is what app engine is specifically using) should confirm the same result.

As an aside, it's very correct on your part to want to ensure you're using Python 2.5 for app engine purposes -- using 2.6 or 2.7 would give some occasional strange results, and, worse, would accept some code (using post-2.5 features) that then would not run on Google's app engine servers (which are using 2.5).

Alex Martelli
When I type python -V, i do get "Python 2.5.4", and also for /usr/bin/env python -V, but I'm still getting an issue using easy_install where it is choosing python 2.6 :/ should I remove that/how do i change easy_install path?
tlow
You need to have a separate `easy_install` for each version of Python you want to use. If you are using the Apple-supplied python 2.5 in OS X 10.6, you'll find a /usr/bin/easy_install-2.5 for it. If you installed python 2.5 for OS X from python.org, follow the instructions for either setuptools (http://pypi.python.org/pypi/setuptools) or Distribute (http://pypi.python.org/pypi/distribute). Either one will put an easy_install in `/Library/Frameworks/Python.framework/Versions/2.5/bin` which you should put at the front of your shell PATH.
Ned Deily
GoogleAppEngineLauncher seems to want to use python 2.6 under Snow Leopard by default. You can make it use 2.5 by explicitly setting /usr/local/bin/python2.5 i the Preferences; note that the UI is really horrible and you need to hit Enter in the dialog box despite the absence of an OK button.
Wooble