ImageField problems - dynamic module does not define init function

700 views
Skip to first unread message

erik...@king.com

unread,
Mar 31, 2016, 5:32:50 AM3/31/16
to djangae-users
I'm experimenting with the ImageFields and cloudstorage and while it works locally I can't get it to work when deployed to GAE. When I try to upload I get the error

from PIL import _imaging as core
ImportError: dynamic module does not define init function (init_imaging)


I have PIL in my libraries:
libraries:
- name: PIL
  version: "1.1.7"


I've tried different images, both large and small, both png and jpg, and everything gives the same error. I've read some other threads about the issue, but haven't found any answers. Is there some documentation somewhere on how to get ImageFields to work properly or has anyone else gotten this problem and managed to solve it?

erik...@king.com

unread,
May 27, 2016, 7:59:29 AM5/27/16
to djangae-users, erik...@king.com
I finally found the answer to this, so I'll drop it here if anyone else has the same problem in the future.

My problem was that I had PIL installed via App Engine AND in sitepackages, but I was not excluding PIL in my app.yaml. This causes app engine to try and and use the sitepackages version in production instead of the one bundled with app engine, and this fails since it's not hooked up correctly to the c-libraries in the background.

So I needed to add skip_files.

libraries:
- name: PIL
  version
: "1.1.7"

skip_files:
    - sitepackages/PIL*

Adam Alton

unread,
May 27, 2016, 8:51:31 AM5/27/16
to erik...@king.com, djangae-users
Thanks for the update Erik!

--
You received this message because you are subscribed to the Google Groups "djangae-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to djangae-user...@googlegroups.com.
To post to this group, send email to djanga...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/djangae-users/7bdd3d8b-3853-46e8-ade7-f90fa66b8585%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

abdul...@brio.co.in

unread,
Jul 12, 2016, 12:03:02 AM7/12/16
to djangae-users, erik...@king.com
Thanks for the solution. It works

dfa...@gmail.com

unread,
May 29, 2019, 4:31:16 PM5/29/19
to djangae-users
Thank you Erik!!

Chatgpt Ntust

unread,
Dec 13, 2023, 1:06:35 PM12/13/23
to djangae-users
oh hi all, how to find app.yaml ? could you please tell me more detail. thanks
Reply all
Reply to author
Forward
0 new messages