Snow Leopard

11 views
Skip to first unread message

Glenn

unread,
Nov 4, 2009, 9:37:19 AM11/4/09
to Google App Engine
I'm running Snow Leopard and therefore by default Python 2.6.

I know that I need Python 2.5.

I'm running the first "Hello, World" example, and trying the following
at the Unix prompt in Terminal:

%python2.5 /usr/local/bin/dev_appserver.py helloworld/

and this is what I get:

Traceback (most recent call last):
File "/usr/local/bin/dev_appserver.py", line 60, in <module>
run_file(__file__, globals())
File "/usr/local/bin/dev_appserver.py", line 57, in run_file
execfile(script_path, globals_)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver_main.py", line 65, in <module>
from google.appengine.tools import os_compat
ImportError: cannot import name os_compat

What am I missing?

Thanks.

ryan baldwin

unread,
Nov 4, 2009, 1:51:27 PM11/4/09
to google-a...@googlegroups.com
You have to switch to 2.5. Easy to do.

Open a terminal and throw this command to the wind:

defaults write com.apple.versioner.python Version 2.5

Enjoy!

- ryan.

Glenn

unread,
Nov 4, 2009, 10:23:02 PM11/4/09
to Google App Engine
Ryan,

Thank you very much for the tip.

I did as you suggested, and as evidence of it making the switch, when
I invoke "python", I see that it's now 2.5.4:

% defaults write com.apple.versioner.python Version 2.5

% defaults read com.apple.versioner.python
{
Version = "2.5";
}

% python
Python 2.5.4 (r254:67916, Jul 7 2009, 23:51:24)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()

However, when I run the AppEngine I still get the same result:

% python /usr/local/bin/dev_appserver.py helloworld/
Traceback (most recent call last):
File "/usr/local/bin/dev_appserver.py", line 60, in <module>
run_file(__file__, globals())
File "/usr/local/bin/dev_appserver.py", line 57, in run_file
execfile(script_path, globals_)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver_main.py", line 65, in <module>
from google.appengine.tools import os_compat

The same happens if I use the AppEngine Launcher.

Chris Tan

unread,
Nov 5, 2009, 3:00:39 AM11/5/09
to Google App Engine
In the launcher preferences enter this for your python path:
/usr/bin/python2.5

Good luck,
Chris

Glenn

unread,
Nov 5, 2009, 9:52:39 AM11/5/09
to Google App Engine
I had already done that. Here's the console from the Launcher:

*** Running dev_appserver with the following flags:
--admin_console_server= --port=8080
Python command: /usr/bin/Python2.5
Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
dev_appserver.py", line 60, in <module>
run_file(__file__, globals())
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
dev_appserver.py", line 57, in run_file
execfile(script_path, globals_)
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/
GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/
google/appengine/tools/dev_appserver_main.py", line 65, in <module>
from google.appengine.tools import os_compat
ImportError: cannot import name os_compat

> > > > I'm runningSnowLeopardand therefore by default Python 2.6.

Ross M Karchner

unread,
Nov 5, 2009, 12:19:55 PM11/5/09
to google-a...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages