Google App Engine, Library PIL, Image, The _imaging C module is not installed

339 views
Skip to first unread message

Dennis Hafemann

unread,
Aug 26, 2013, 12:11:46 PM8/26/13
to google-a...@googlegroups.com

Hi there,

I am on project using Google App Engine and third party library PIL.

Currently I am trying to just create a new image, via PIL's submodule Image

So my local installation with Python 2.7.4 running works just finde with PIL:

$ python
Python 2.7.4 (default, Apr 19 2013, 18:28:01) 
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from PIL import Image
>>> img=Image.new("RGBA", (100, 100))
>>> if img: print True
... 
True
>>> 

My app.yaml, includes following libraries-information:

...
runtime: python27
...
libraries:
- name: PIL
  version: latest
I deployed my application being convident having it running. ... but ... the online-version of Google App Engine logged some errors:

...
    img=Image.new("RGBA", (width, height))
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/PIL-1.1.7/PIL/Image.py", line 1763, in new
    return Image()._new(core.fill(mode, size, color))
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/PIL-1.1.7/PIL/Image.py", line 37, in __getattr__
    raise ImportError("The _imaging C module is not installed")
ImportError: The _imaging C module is not installed

(... and to make sure, I tried "version: 1.1.7" in my app.yaml).

I also tried importing _imaging from my local python-installation, but didn't get it running. I neither find anything helpful about this.

Does anyone have a helpful tipp to solve this problem ?

Thanks in advance.

Vinny P

unread,
Aug 27, 2013, 10:13:39 PM8/27/13
to google-a...@googlegroups.com
On Mon, Aug 26, 2013 at 11:11 AM, Dennis Hafemann <dennis....@gmail.com> wrote:
So my local installation with Python 2.7.4 running works just finde with PIL:

$ python
Python 2.7.4 (default, Apr 19 2013, 18:28:01) 
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from PIL import Image
>>> img=Image.new("RGBA", (100, 100))
>>> if img: print True
... 
True
>>> 


 
 
I see you've tested your code using the Python interpreter and the App Engine production environment. But have you tried running your app on the dev appserver in the GAE Python SDK? Try it and see what errors crop up. 
 
 
On Mon, Aug 26, 2013 at 11:11 AM, Dennis Hafemann <dennis....@gmail.com> wrote:
(... and to make sure, I tried "version: 1.1.7" in my app.yaml).
 
 
 
Can you try using version: "1.1.7" (include the quotation marks)?
 
 
 
-----------------
-Vinny P
Technology & Media Advisor
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com
 
 

Dennis Hafemann

unread,
Aug 28, 2013, 1:45:18 AM8/28/13
to google-a...@googlegroups.com

I see you've tested your code using the Python interpreter and the App Engine production environment. But have you tried running your app on the dev appserver in the GAE Python SDK? Try it and see what errors crop up. 
 

I did. I developed the whole Application within a local installation of GAE SDK ...

release: "1.8.0"
timestamp: 1367368689
...

Enviroment is Ubuntu 12.10 and Ubuntu 13.04 with raw OS Python installation from repositories... I installed python-imaging to have PIL locally available. All works fine. ... The online-GAE throws this The _imaging C module is not installed-error.

 
 
Can you try using version: "1.1.7" (include the quotation marks)?
 
 
I did ...  I tried ...

version: latest
version
: "latest"
version
: 1.1.7
version
: "1.1.7"

Nothing changed after each variant.

sco...@referabuyer.com

unread,
Dec 6, 2013, 1:44:10 PM12/6/13
to google-a...@googlegroups.com
Hey Dennis,

Did you find a solution to this issue?  I'm having the same problem...

Dennis Hafemann

unread,
Dec 6, 2013, 2:06:19 PM12/6/13
to google-a...@googlegroups.com
Hey Scott,

actually not... The Python-Version on Google App Engine seems to be compiled without necessary libraries ... I guess because of memory-leaking and security issues... I don't know... I tried the hell everthing

To solve my problem I forked PyPNG on GitHub, changed it to make it work with streams, used it as a submodule, worked pretty fine, so that's why I didn't do any further researches ... Take a look on my project, maybe it helps you out to solve your problem.


Regards,
Dennis

----------


--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/oAZT_ZUpPi0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.

sco...@referabuyer.com

unread,
Dec 6, 2013, 2:34:22 PM12/6/13
to google-a...@googlegroups.com
Hmm that's really weird that there is that limitation.  Thanks for sharing your solution, you've saved me a lot of time where I would've been banging my head against the keyboard!
Reply all
Reply to author
Forward
0 new messages