Pyramid on GAE / Python 2.7

121 views
Skip to first unread message

Andreas Reuleaux

unread,
Dec 5, 2011, 1:49:49 PM12/5/11
to pylons-...@googlegroups.com
According to the docs [1] / release notes [2] google app engine
runs on python2.7 now, i. e. no need to use python2.5 any more.

I wonder if anyone has bothered to try out pyramid on this
gae/python2.7 combination and would update the docs?
In particular the tutorial "Running Pyramid on Google’s App Engine" [3]
still refers to python2.5, also I am not sure if the appengine-monkey
described in this tutorial is still needed?

-Andreas


[1] http://code.google.com/appengine/docs/python/gettingstartedpython27/
[2] http://code.google.com/p/googleappengine/wiki/SdkReleaseNotes
[3] http://docs.pylonsproject.org/projects/pyramid/en/1.2-branch/tutorials/gae/index.html

Mike Orr

unread,
Dec 5, 2011, 2:15:11 PM12/5/11
to pylons-...@googlegroups.com
On Mon, Dec 5, 2011 at 10:49 AM, Andreas Reuleaux <reul...@web.de> wrote:
> According to the docs [1] / release notes [2] google app engine
> runs on python2.7 now, i. e. no need to use python2.5 any more.
>
> I wonder if anyone has bothered to try out pyramid on this
> gae/python2.7 combination and would update the docs?
> In particular the tutorial "Running Pyramid on Google’s App Engine" [3]
> still refers to python2.5, also I am not sure if the appengine-monkey
> described in this tutorial is still needed?

I think I heard that GAE supports Setuptools now, so the monkey may
not be needed anymore. If you can run the application without getting
ImportError on Python standard library modules, you should be OK.
After the year-long controversy this caused with GAE not supporting
pkg_resources.require(); I'd be very surprised if they didn't make
sure Python 2.7 ran smoothly with it.

--
Mike Orr <slugg...@gmail.com>

Andreas Reuleaux

unread,
Dec 5, 2011, 3:07:05 PM12/5/11
to pylons-...@googlegroups.com
OK, thanks so far. I will have a go and see if it works.

-Andreas

Mike Orr

unread,
Dec 5, 2011, 5:22:12 PM12/5/11
to pylons-...@googlegroups.com
On Mon, Dec 5, 2011 at 12:07 PM, Andreas Reuleaux <reul...@web.de> wrote:
>>> According to the docs [1] / release notes [2] google app engine
>>> runs on python2.7 now, i. e. no need to use python2.5 any more.
>>>
>>> I wonder if anyone has bothered to try out pyramid on this
>>> gae/python2.7 combination and would update the docs?
>>> In particular the tutorial "Running Pyramid on Google’s App Engine" [3]
>>> still refers to python2.5, also I am not sure if the appengine-monkey
>>> described in this tutorial is still needed?

The docs say several more libraries are available in the runtime
environment, including Setuptools.

http://code.google.com/appengine/docs/python/python27/using27.html#Configuring_Libraries

The interface can also activate a WSGI application directly rather
than going through a CGI emulation step. If the tutorial is doing the
latter, that can be streamlined now.

--
Mike Orr <slugg...@gmail.com>

Thomas G. Willis

unread,
Dec 5, 2011, 10:03:31 PM12/5/11
to pylons-...@googlegroups.com
Actually, as the first link indicates, python2.7 is still experimental on GAE. 

I've been trying to port an app to the 2.7 runtime for a few weeks now and it's not going smoothly to say the least. 

Most of the trouble is I believe is related to the SDK/dev server does not quite support 2.7 yet. 

I'm sure a pyramid "hello world" would work just fine though. :)

Andreas Reuleaux

unread,
Dec 6, 2011, 5:27:56 AM12/6/11
to pylons-...@googlegroups.com

Thanks for your encouragement ;-)

Did you try with GAE 1.6.0? The release notes (the 2nd link above) say:
"The SDK now supports Python 2.7."

-Andreas

Thomas G. Willis

unread,
Dec 6, 2011, 7:09:12 AM12/6/11
to pylons-...@googlegroups.com
Yeah, sdk 1.6, it's quite discouraging. 


Thomas G. Willis

unread,
Dec 7, 2011, 11:10:15 AM12/7/11
to pylons-...@googlegroups.com
just a little update based on my further experimentation today....

The only way to even run your app under 2.7 is to deploy it to the cloud according to this thread.


I think there were other threads as well where the "sdk supports 2.7" was causing a lot of confusion. I don't know how they can make that claim when the sdk ships with the 2.5 libraries (webob 0.9) but not the 2.7 libraries and no instructions(as far as I know) on how to install them.

So what is the answer to "Pyramid on GAE 2.7"? I guess it would be "kind of", Personally, I'm not going to use something that I have to deploy to another machine or the sexy cloud in order to test, that just seems stupid in 2011 unless you are a J2EE developer. 

Now, as far as pyramid on GAE 2.5? As far as version 1.0 goes, Hell yes it works, It's awesome. I'm very happy with it and I'm glad that I was able to convince my employer last year when it was still called repoze.bfg to let me ditch the web2py app and re-write it in bfg, and just ignore the django/django-nonrel.

I think google jumped the gun on making the 2.7 runtime available to everyone honestly, it's not ready for anything non-trivial. They don't seem to be in any position to support an SDK for it just yet. 


So bottom line, if you want to use appengine and pyramid, you can, but you have to use the python2.5 runtime, and it may be a challenge overriding the provided webob in my experience.

my .02

Thomas G. Willis

unread,
Dec 9, 2011, 1:05:21 PM12/9/11
to pylons-...@googlegroups.com
Sorry to revive an oldish thread, but if anyone cares I have more info on this.

So running pyramid on GAE 2.7 is possible. That being said, here's the caveats I've come across that may be of interest to others.Note: the issues don't really have anything to do with pyramid.

#1: if you use nosegae, you will have to patch google_appengine/lib with webob1.1.1 because it still ships with webob0.9 and the nosegae plugin makes it pretty much impossible to to load webob from anywhere else for unit tests as far as I could tell.

#2: i said webob1.1.1 because webob>1.1.1 causes dev_appserver_blobstore.py to error out before your tests even get run.


I really can't agree with the claim that python2.7 on appengine works and it works great and is awesome. I'm experiencing very slow response times on GAE python2.7 versus the GAE python2.5 version. The difference is at least 10x which is the exact opposite of awesome and stretch to say that it works. But I guess if you don't use the datastore or return a response of nothing more than maybe 1KB maybe you won't notice. :)

I'm nowhere near an authority on AppEngine, but my recommendation would be to wait. 
Reply all
Reply to author
Forward
0 new messages