Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Google App Engine SDK with Python 2.7 on Mac OS X 10.6

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
like image 393
Yarin Avatar asked Nov 14 '11 20:11

Yarin


2 Answers

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 .

like image 192
systempuntoout Avatar answered Oct 04 '22 16:10

systempuntoout


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.

like image 20
aquacode Avatar answered Oct 04 '22 17:10

aquacode