A bit of background from the PIL setup.py build:
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version 1.1.7
platform linux2 2.6.2 (release26-maint, Apr 19 2009, 01:58:18)
[GCC 4.3.3]
--------------------------------------------------------------------
*** TKINTER support not available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
*** LITTLECMS support not available
--------------------------------------------------------------------
This is on an Ubuntu 9.04 installation.
I only need PIL to enable Django to upload and resize various images (of different formats). Unfortunately, it can't currently process JPEGs. After performing PIL's selftest.py, it came up with this:
*** The _imaging C module is not installed
I tried importing Image and _imaging using the python -v interpreter (which both worked)...
>>> from PIL import Image
import PIL # directory PIL
# PIL/__init__.pyc matches PIL/__init__.py
import PIL # precompiled from PIL/__init__.pyc
# PIL/Image.pyc matches PIL/Image.py
import PIL.Image # precompiled from PIL/Image.pyc
[continues successfully for quite a while]
>>> import _imaging
dlopen("/usr/local/lib/python2.6/dist-packages/PIL/_imaging.so", 2);
import _imaging # dynamically loaded from /usr/local/lib/python2.6/dist-packages/PIL/_imaging.so
So _imaging is available when using the python interpreter, but for some reason isn't being imported properly in other instances.
I've been looking for solutions to this problem for the last several hours and haven't come any closer to finding one. Am I missing something stupidly obvious? Or are there any ideas as to why it isn't working?
Thanks in advance!
Also: I am aware of http://effbot.org/zone/pil-imaging-not-installed.htm but that only demonstrates the error and provides no solution.
EDIT: I've been snooping around and it appears that importing _imagingmath is the problem. I did python -vv selftest.py to see where it was breaking, and this is how it happened:
dlopen("/usr/local/lib/python2.6/dist-packages/PIL/_imagingmath.so", 2);
import _imagingmath # dynamically loaded from /usr/local/lib/python2.6/dist-packages/PIL/_imagingmath.so
*** The _imaging C module is not installed
# clear __builtin__._
[etc. etc. etc.]