Reputation: 529
Installed the Google App Engine SDK.Python 2.6 perfect. Wanted to go into images, and test locally.Installed PIL
Installed Python, then ran the PIL install, worked this time.
Things seemed good, but trying to do localhost image manipulation gives:
"NotImplementedError: Unable to find the Python PIL library. Please
view the SDK documentation for details about installing PIL on your system."
System : winxp
Upvotes: 12
Views: 16417
Reputation: 56
For OSX 10.11.6 and Python 2.7.13 I needed to install pyyaml
in addition to Pillow
globally in order for the launched API server to pick them up:
sudo pip install Pillow pyyaml
After this I had to specifically add the PIL version 1.1.7
into the app.yaml libraries, even though the Pillow version was NOT 1.1.7:
libraries:
- name: PIL
version: 1.1.7
The way I found that I was missing the yaml
library is described in more detail in this comment:
Upvotes: 3
Reputation: 11404
I've run into the same issue on Windows machine and then I've notice in the App Engine Docs:
Note: In addition to the Images API, you can also use the transforms provided in the Python Imaging Library (PIL) in your Python 2.7 app. You simply declare the library in the libraries section of the app.yaml file. However, if you wish to use PIL in your local environment (using the development server) you must also download and install PIL or pillow locally.
So just download PIL and it will work.
Upvotes: 0
Reputation: 1220
I took a while to get PIL working. Mainly because I forgot to tell app engine to load it in the yaml file:
libraries:
- name: PIL
version: 1.1.7
Maybe this step is obvious, but I did not see it documented well on google documentation and I found all kinds of messages here stating that PIL was not available on app engine. I want to confirm that PIL is running on app engine.
Upvotes: 11
Reputation: 2330
If you clear your GAE log window (assuming you're using the launcher) then restart your server, you might see something in the log. In my case I got
WARNING 2011-01-27 21:04:11,856 dev_appserver.py:3698] Could not initialize images API; you are likely missing the Python "PIL" module. ImportError: dlopen(/Library/Python/2.6/site-packages/PIL/_imaging.so, 2): Symbol not found: _jpeg_resync_to_restart Referenced from: /Library/Python/2.6/site-packages/PIL/_imaging.so
So I could tell that I didn't link well enough with the JPEG library.
Upvotes: 1
Reputation: 4323
On Ubuntu with python2.5 the following helps:
new repo: ppa.launchpad.net/fkrull/deadsnakes/ubuntu
sudo apt-get install python2.5 python2.5-dev libjpeg62 libjpeg62-dev
untar: http://effbot.org/media/downloads/Imaging-1.1.6.tar.gz
cd Imaging-1.1.6
edit setup.py line 38: JPEG_ROOT = libinclude("/usr/lib")
sudo python2.5 setup.py install
Done
Upvotes: 3
Reputation: 41541
As far as I know Google AppEngine does not allow to use PIL directly, but instead provides a limited Images API.
It can resize/rotate/crop and flip images. More or less what Picasaweb can do. But it cannot create new images or do complex things like adding text, drawing etc.
Upvotes: 4
Reputation: 241970
We're probably going to need more information, so here are some questions and things to try.
How are you trying to access the PIL? Are you trying to use the google.appengine.api.images module, or PIL directly? It sounds like the former, but it's not clear.
Did you follow the App Engine instructions?
Post code, if you can.
Perhaps the most important thing to try: see if you can use PIL from a non-App Engine script. Just write a quick Python script that accesses it and see how that goes. Something like:
import Image
im = Image.open('filename.png')
im.show()
If that doesn't work, it's not surprising that Google App Engine wouldn't work with PIL.
Upvotes: 4