Below you'll find an updated example that does work for Mac. Basically you have to add the yaml lib directory to the sys.path.
#!/usr/bin/python
import code
import getpass
import os
import sys
DIR_PATH = "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine"
EXTRA_PATHS = [
DIR_PATH,
os.path.join(DIR_PATH, 'lib', 'yaml', 'lib'),
]
sys.path = EXTRA_PATHS + sys.path
from google.appengine.ext.remote_api import remote_api_stub
from google.appengine.ext import db
def auth_func():
return raw_input('Username:'), getpass.getpass('Password:')
if len(sys.argv) < 2:
print "Usage: %s app_id [host]" % (sys.argv[0],)
app_id = sys.argv[1]
if len(sys.argv) > 2:
host = sys.argv[2]
else:
host = '%s.appspot.com' % app_id
remote_api_stub.ConfigureRemoteDatastore(app_id, '/remote_api', auth_func, host)
code.interact('App Engine interactive console for %s' % (app_id,), None, locals())
That's all it takes. Hope you find it helpful. I'll also drop a line to the appengine team to let them know about these changes.
6 comments:
that was just what I needed. Thanks!
That did the trick! Thanks !!
For me it didn't work on Windows either until I did this. Thanks!
Very helpful BTW...on Windows it's
sys.path.append("C:\Program Files\Google\google_appengine\lib\yaml\lib")
Weird that Google "forgot" to mention that you had to add that path in to use the remote_api. Thanks for the article. Great catch.
I solved the problem installing the yaml module bundled in the google appengine
> cd [google-appengine-dir]
> cd lib/yaml
> sudo python setup.py install
No google code modifications needed in my Ubuntu
on my vista 64-bit i did
sys.path.append("C:\Program Files (x86)\Google\google_appengine\lib\yaml\lib")
but i am still getting the same error ?? can any one help me out.. its annoying
Post a Comment