[Fixed]-PIL – libjpeg.so.8: cannot open shared object file: No such file or directory

21👍

See an explanation here: Why can't Python find shared objects that are in directories in sys.path?

A quick fix is to add the directory that contains libjpeg.so.8 to your /etc/ld.so.conf file, and then run ldconfig

5👍

Also if you are doing local Python installations you can also control dynamic linking on the session level using LD_LIBRARY_PATH environment variable::

 export LD_LIBRARY_PATH=/srv/plone/python/python-2.6/lib
 python
 import _imaging
 ...

This way you cannot break your OS itself, even accidentally. (It happens: http://opensourcehacker.com/2011/08/31/zend-server-installation-potentially-kills-your-ssh/)

0👍

Compiling the library from source works too: http://www.ijg.org/files/

Make sure to use jpegsrc.v8.tar.gz if you’re on a Unix like system though. jpegsr8.zip appears to be the MS version, and throws all the standard formatting issues while building.

👤gratio

0👍

maybe just install libjpeg

conda install -c conda-forge libjpeg-turbo

Leave a comment