While trying to use PIL on a Arch linux box (python 2.6.7) I kept getting the dreaded "The _imaging C module is not installed" error message. I tried installing libjpeg using pacman and from source. I tried installing freetype2 using pacman and from source. After each of these attempts, I reinstalled PIL with the --update option and went through the...
python >> import Image >> import _imaging
to test. None of this helped. My libjpeg.so file was in /usr/local/lib, so I added that to sys.path; still didn't work. I finally resolved the problem with ldconfig.
ldconfig /usr/local/lib/
Salvation! Not sure why this worked and adding /usr/local/lib to sys.path didn't, but it got resolved, so I'm OK with it.
UPDATE: Last time this happened to us, we needed to:
restart node <- maybe we don't need to do this, we were in panic mode. run ldconfig (ldconfig) <- without any arguments test import (python > import Image > import _imaging) stop apache (/etc/rc.d/httpd stop) restart memcached (/etc/rc.d/memcached restart) start apache (/etc/rc.d/httpd start) pray (hands together)Share on Twitter Share on Facebook