Testing Google App Engine app from terminal (python cli)
Question: I'm running `from appname import model`, which gives me:

    
    
    ImportError: No module named google.appengine.api
    

So I add the following Python path (the only path I could `find`):

`PYTHONPATH=/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-
default.bundle/Contents/Resources/google_appengine/:~/src/appname/src/ python`

And then I run the command again. But that tells me:

    
    
    ImportError: No module named yaml
    

I'm running Mac OS X Snow Leopard and the latest GAE. Any tips? All I want to
do is run some of the methods in my model.


Answer: From dev_appserver.py:

    
    
    DIR_PATH = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
    # ...
    
    EXTRA_PATHS = [
      DIR_PATH,
      os.path.join(DIR_PATH, 'lib', 'antlr3'),
      os.path.join(DIR_PATH, 'lib', 'django'),
      os.path.join(DIR_PATH, 'lib', 'fancy_urllib'),
      os.path.join(DIR_PATH, 'lib', 'ipaddr'),
      os.path.join(DIR_PATH, 'lib', 'webob'),
      os.path.join(DIR_PATH, 'lib', 'yaml', 'lib'),
    ]
    # ...
    sys.path = EXTRA_PATHS + sys.path
    

I think it should work if you put these bits in a separate script, and import
it before importing your own code.

Or, as you've pointed out, use the Appengine console in the SDK (but that's
not there for Linux users).

