[mod_python] PIL not working in mod_python on macosx 10.5

Arnaud Delobelle delobelle at blueyonder.co.uk
Tue Nov 6 16:41:49 EST 2007


First thanks to Graham for pointing me in the right direction so that  
I was able to install mod_python on macosx 10.5.  Unfortunately I have  
run into another hitch:  the PIL (Python Imaging Library) is not  
working from within mod_python, even though it is working from command- 
line python:

If I create a new image from mod_python, I get the error "The _imaging  
C module is not installed".
The module _imaging.so is in /Library/Python/2.5/site-packages/PIL/ 
_imaging.so and I have checked that /Library/Python/2.5/site-packages/ 
PIL/ is present in sys.path from within mod_python.

I am now unable to progress any further... When I first unsuccessfully  
installed mod_python, the problem was that it compiled as an i386  
module whereas httpd is x86_64 on macosx 10.5 (on Intel Core 2 Duo).   
My first reaction was that _imaging.so was for the wrong architecture  
as well:

marigold:~ arno$ file /Library/Python/2.5/site-packages/PIL/_imaging.so
/Library/Python/2.5/site-packages/PIL/_imaging.so: Mach-O universal  
binary with 2 architectures
/Library/Python/2.5/site-packages/PIL/_imaging.so (for architecture  
i386):	Mach-O bundle i386
/Library/Python/2.5/site-packages/PIL/_imaging.so (for architecture  
ppc7400):	Mach-O bundle ppc

But on the other hand, the same goes for python:

marigold:~ arno$ file `which python`
/usr/bin/python: Mach-O universal binary with 2 architectures
/usr/bin/python (for architecture ppc7400):	Mach-O executable ppc
/usr/bin/python (for architecture i386):	Mach-O executable i386

Having no understanding of how mod_python works, I can't decide if  
this is the problem or not (forcing httpd to run as an i386 process  
would probably tell me the answer, but I don't know how to).  But if  
it is not, what prevents _imaging.so from loading?

Thanks for reading this far.


More information about the Mod_python mailing list