[Image-SIG] import _imaging fails in CGI
Jay Dorsey
python at jaydorsey.com
Wed Jul 9 12:45:40 EDT 2003
I'm on Solaris 8, netscape server, Python 2.3a1. I finally got PIL
1.1.4 installed this morning. I can run everything just fine from the
command line. When I try a regular import Image in the CGI script, it
imports ok (I assume), but I get the "ImportError: The _imaging C module
is not installed" error. I checked the effbot site again (too much
useful information there -- where does he find the time?),
http://effbot.org/zone/pil-imaging-not-installed.htm. I do have an
_imaging module, located in /usr/local/lib/python2.3/site-packages/PIL.
Doing an "import _imaging" from CLI, gives me:
dlopen("/usr/local/lib/python2.3/site-packages/PIL/_imaging.so", 2);
import _imaging # dynamically loaded from
/usr/local/lib/python2.3/site-packages/PIL/_imaging.so
When I do an "import _imaging" in my CGI script, I get the following:
ImportError: ld.so.1: /usr/local/bin/python: fatal: libjpeg.so.62: open
failed: No such file or directory
I printed out my sys.path, and os.environ. My sys.path is correct, it
points to the PIL directory (among others). os.environ doesn't show a
LD_LIBRARY_PATH, but I set one (/usr/local/lib) before I import the
_imaging module (also, I tried before Image). I checked for a
libjpeg.so.62 file to make sure I had one -- I do. Its located in
/usr/local/lib/. Its a symlink to /usr/local/lib/libjpeg.so.62.0.0
however. So, I tried re-compiling PIL with
--with-jpeg=/usr/local/lib/libjpeg.so.62.0.0, but couldn't get PIL to
compile using this method (I'm not sure that it even *should* work).
I also checked the server, and it has a LD_LIBRARY_PATH of
/usr/local/lib set upon start as well.
Running 'ldd _imaging.so' shows me the link 'libjpeg.so.62 =>
/usr/local/lib/libjpeg.so.62' (among others).
I found a newsgroup post on google suggesting 1. to recompile PIL to
statically link to libjpeg , 2. recompile with -R so PIL remembers where
the dynamic libs are, or 3. modify the server start script to set the
enviroment variable. I don't think its a coincidence that the original
poster was on a solaris machine either.
3 doesn't work (its already set), and I'm not sure exactly where/how to
do 1 or 2 (though I'm snooping through all the make files and configure
scripts).
Unfortunately, there was no real closure on the matter, so I'm not sure
what the original poster did.
Any suggestions?
THanks for your time.
Jay
More information about the Image-SIG
mailing list