[Image-SIG] another libjpeg problem - PIL can't find it atruntime? (long)

john walshaw (JIC) john.walshaw at bbsrc.ac.uk
Thu Sep 28 19:05:47 CEST 2006




Fredrik Lundh wrote:

> john walshaw (JIC) wrote:
> > 
> > because that's where the libjpeg.a and jpeglib.h files are, 

> 
> did you build these yourself ?
> 
> one brute-force workaround worth trying is to remove all 
> libjpeg files 
> except the static library (libjpeg.a) from /usr/local/lib and 
> rebuild, 
> to force the linker to do a static build.
> 

thanks for the suggestion. I've tried it out, and the short story is
that again the compilation completes, but I'm now getting a different
runtime problem when I import the _imaging library - I get this:

>>> import sys
>>> sys.path.insert(1,"PIL")
>>> import _imaging
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: dlopen: Cannot map library PIL/_imaging.so


The long story is - first to answer your question, I hadn't built
libjpeg myself, so one thing I tried was getting the most recent source
and building this again, and using that for the compilation, ensuring
that the older one doesn't get used. I have the same error when trying
to import the _imaging built with the new one.

As far as forcing a static build using libjpeg.a goes - I did try the
brute force method, producing the _libjpeg.so which gives the above
error. 
However I also tried a cleaner way of doing this with running the linker
with -non_shared, and -ljpeg, and forcing (with -L ) the linker to never
look anywhere except the dirs specified with the other -L qualifiers.
This produced the same error unfortunately.

I also tried doing both the non-static and static builds using the
native cc instead of gcc which setup.py uses by default, but in each
case the cc build gives the same respective run-time error as with gcc.
(I have another beginner's question here - how do I cleanly tell
setup.py which compiler and directives to use?).

Finally, I decided to do a fresh install of Python itself, so I
installed Python 2.5 in a separate location, and used the 2.5 executable
to do the PIL build and then attempt the import of _imaging - but I got
the same error message as before.

Any ideas, or if anyone on this list has PIL on Tru64, I'd be grateful
to hear from them.

best wishes

John

 


More information about the Image-SIG mailing list