views:

273

answers:

3

I am using OS X 1.6 snow leopard and I successfully got PIL installed. I am able to open terminal and type import Image without any errors.

However, When using app engine I get Image error still saying that PIL is not installed. I am wondering if any of you have an thoughts as to how I can resolve this issue.

-Matthew

+3  A: 

Apparently Google provides the PIL in the google.appengine.api.images module. You can see examples on how to use it in the App Engine Documentation - Using the Images Python API.

Daniel DiPaolo
To use their images API in the SDK, you have to install PIL yourself: http://code.google.com/appengine/docs/python/images/installingPIL.html
Will McCutchen
Which he has already done *successfully* on his local machine. You don't need to install it on app engine itself. The issue is that he's trying to access it as `Image` and that's not what the module is named on GAE
Daniel DiPaolo
A: 

How did you install PIL? If I remember correctly, I had to install it via MacPorts to get the App Engine SDK to recognize that it was installed.

You should probably install Python 2.5 and use that, while you're at it, since that is the Python version that App Engine uses and developing against 2.6 locally could potentially lead to surprising issues when you deploy your app.

Will McCutchen
follow this guys steps on a clean install of snow leopard. If you have installed Python after the fact I am not sure it will work.http://proteus-tech.com/blog/cwt/install-pil-in-snow-leopard/
mswallace
A: 

You cannot use PIL with Appengine; it uses C extensions and won't run in the sandbox environment. You do need to have PIL installed on your local machine to use the images API in dev_appserver, because the SDK version of the images API itself uses PIL, but this doesn't mean you can use all of PIL through the images API; the images API is fairly limited.

Additionally, it's a good idea to use Python 2.5 for development, as the production environment uses version 2.5.2 and not all Python 2.6 syntax will work in production (notably "except FooError as bar"), and the purpose of the development server is to test that your code will work right in production.

Wooble