Note that there are some explanatory texts on larger screens.

plurals
  1. POGAE 1.5.5 local SDK fails to run with python2.7 runtime
    text
    copied!<p><a href="http://googleappengine.blogspot.com/2011/10/app-engine-155-sdk-release.html" rel="nofollow">GAE 1.5.5</a> looks to have some excellent, long-waited for features. However, they're not working for me yet.</p> <p>I've downloaded and installed GAE 1.5.5, and am using a degenerate "AAA" app to test.</p> <p>Here's roughly my app.yaml (with various changes having been made for testing).</p> <h2>app.yaml</h2> <pre><code>application: AAA # mystical creation. version: alpha-1 runtime: python27 api_version: 1 threadsafe: true handlers: - url: /media static_dir: media/ - url: /favicon.ico static_files: media/images/favicon.ico upload: media/images/favicon.ico - url: /admin script: AAA.app login: admin - url: /.* script: AAA.app skip_files: - ^(.*/)?app\.yaml libraries: - name: django version: "1.2" - name: jinja2 version: latest - name: yaml version: latest </code></pre> <p>I'm running this on Mac OS X Lion (10.7.1).</p> <p>I hypothesize that I am not actually using the Python 2.7 runtime, in spite of the declaration in app.yaml to use it. I'm not quite sure how to validate this theory, but the errors I've encountered are consistent with it. These errors are reproduced below.</p> <h1>Python Path</h1> <p>When Google App Engine's Python Path is not set, the app engine runs using Python 2.6.6.</p> <p>To fix this I set Python Path to <code>/usr/bin/python2.7</code> in the Google App Engine preferences.</p> <h1>WSGI</h1> <p>I get the following error:</p> <pre><code> /Applications/GoogleAppEngineLauncher.app/Contents/Resources/ GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/ google/appengine/tools/dev_appserver.py in GetParentPackage(self=&lt;google.appengine.tools.dev_appserver.HardenedModulesHook object&gt;, fullname='AAA.app') 2334 2335 if self.find_module(fullname) is None: =&gt; 2336 raise ImportError('Could not find module %s' % fullname) 2337 2338 return self._module_dict[parent_module_fullname] builtin ImportError = &lt;type 'exceptions.ImportError'&gt;, fullname = 'AAA.app' &lt;type 'exceptions.ImportError'&gt;: Could not find module AAA.app args = ('Could not find module AAA.app',) message = 'Could not find module AAA.app' </code></pre> <p>Where I've tried AAA.app as:</p> <h3>AAA.py:</h3> <pre><code> from google.appengine.dist import use_library use_library('django', '1.2') # otherwise we still get django 0.96 from django.core.handlers import wsgi app = wsgi.WSGIHandler() </code></pre> <h3>AAA/<code>__init__.py</code></h3> <pre><code># same content as above </code></pre> <h3>AAA/AAA.py</h3> <pre><code># same content as above </code></pre> <p>Note that I can continue to run CGI with app.yaml and AAA.py modified, <em>mutatis mutandis</em>. However doing so nevertheless results in those errors below:</p> <h1>Jinja2</h1> <p>When I run <code>import jinja2</code> I get an <code>ImportError</code>.</p> <h1>Django2</h1> <p>Without:</p> <pre><code>from google.appengine.dist import use_library use_library('django', '1.2') </code></pre> <p>I end up with Django 0.96.</p> <h1><em>Theory</em></h1> <p>Given the following:</p> <ul> <li><a href="http://code.google.com/appengine/docs/python/tools/libraries27.html" rel="nofollow">http://code.google.com/appengine/docs/python/tools/libraries27.html</a> states "The use_library() function provided by the google.appengine.dist package is unavailable in Python 2.7."</li> <li>use_library works for me</li> <li>use_library is required because the "libraries: {django: {..., version: "1.2"}} declaration does not set the django version to 1.2</li> <li>Only Django 1.2 is included in the Python 2.7 runtime (per the libraries27.html link above)</li> <li>I have to manually specify Python 2.7 in the Python Path in order for GAE to use Python 2.7</li> <li>WSGI doesn't load the application properly</li> <li>Jinja2 cannot be imported</li> </ul> <p>I believe I am not really using the Python 2.7 GAE runtime (i.e. the app.yaml declaration is being ignored in the GAE 1.5.5 SDK).</p> <p>I hope the above is a helpful description, and I'd be grateful for any thoughts as to what may be happening here – and potential solutions.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload