15

I need to run Python 2.7 on my Mac Snow Leopard, which has Python 2.6 installed. According to this answer, running the Python 2.7 mpkg installer from Python.org should get me there.

The reason I need to do this is that I'm trying to run the Google App Engine SDK for the Python 2.7 runtime.

After installing Python 2.7, I'm still getting the following warning in my GAE server log:

Warning: You are using a Python runtime (2.6) that is older than the production runtime environment (2.7).

What else must I do to get the GAE SDK to recognize the new Python version?

EDIT 2:

Running:

$ sudo find / -name python2.7

I get:

/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
/usr/local/bin/python2.7

According to the answers I went into GoogleAppLauncher -> Preferences and set the Python path to each of these, and each time I get the exact same error.

Running dev_appserver with the following flags: --admin_console_server= --port=8081 Python command: /Library/Frameworks/Python.framework/Versions/2.7 2011-11-14 16:12:24.726 GoogleAppEngineLauncher[57590:203] *** NSTask: Task create for path '/Library/Frameworks/Python.framework/Versions/2.7' failed: 22, "Invalid argument". Terminating temporary process.

Another Wierd thing is, it always tries to resolve to the same path, no matter which of those I plug in; It always reverts to /Library/Frameworks/Python.framework/Versions/2.7

EDIT 3:

OK, after entering the paths into the prefs field repeatedly, I finally just cleared it out, and somehow it's now pointing to the right place:

Running dev_appserver with the following flags:
    --admin_console_server= --port=8081
Python command: /usr/local/bin/python2.7
1

4 Answers 4

20

Open the GAE launcher preferences and set the Python Path option to the fresh installed Python 2.7, in your case /usr/local/bin/python2.7 .

Sign up to request clarification or add additional context in comments.

6 Comments

@systempuntout- I just tried this but not getting it right- can you see the edit to my answer.
type whereis python2.7 on your shell, the result should give you the path to the python2.7 bin.
use /usr/local/bin/python2.7 and confirm it with an enter, reopen the preferences and check if it's stored correctly.
Hold the phones- I just cleared out the Python path, and suddenly it seems like its pointing correctly...
@systempuntout - Thanks for sticking with me- much appreciated
|
9

Came across this question looking for a solution to the same dilemma regarding Mac, GAE and Python.

One comment I would like to make regarding setting the Python path using GAE Preferences. I notice you mention that you had a problem setting the Python path using the Preferences. I discovered that after editing the path, you have to press Enter. Otherwise, the path doesn't get updated. This might explain the weirdness you were mentioning when trying to edit the path field.

2 Comments

I would have been going around in circles for hours without this. Thanks!
You'd imagine a Select button or something. You-Da-Man
1

I installed python 2.7.x from macports. I see this:

$ python --version
Python 2.7.2

$ which python
/opt/local/bin/python

So, in the preferences for GoogleAppEngineLauncher.app I set the python path to:

/opt/local/bin/python

In the console log, I see this:

*** Running dev_appserver with the following flags:
    --admin_console_server= --port=8081
Python command: /opt/local/bin/python

I still see some errors about libraries, in particular Can't open zipfile...setuptools but simple stuff at least seems to work.

Good luck!

Comments

0

I am not sure if it helps, but instead of using the binaries from Python, I used MacPorts http://www.macports.org/ and installed the Python 2.7 runtime:

sudo port install python27

1 Comment

@danielrsmith- Thanks, I'll look at that but still not sure how to get the GAE engine to recognize the new version...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.