Compiled the libjpeg v8, PIL 1.1.7 and and import for _imaging works on the system Python, but spouts this error inside the virtualenv:
JavaScript
x
2
1
libjpeg.so.8: cannot open shared object file: No such file or directory
2
here is the error run with a python -v interpreter inside the virtualenv
JavaScript
1
6
1
>>> import _imaging
2
dlopen("/home/ygamretuta/dev/py/django/lib/python2.6/site-packages/PIL/_imaging.so", 2);
3
Traceback (most recent call last):
4
File "<stdin>", line 1, in <module>
5
ImportError: libjpeg.so.8: cannot open shared object file: No such file or directory
6
and here are the paths:
JavaScript
1
13
13
1
/home/ygamretuta/dev/py/django/lib/python2.6/site-packages/distribute-0.6.14-py2.6.egg
2
/home/ygamretuta/dev/py/django/lib/python2.6/site-packages/pip-0.8.1-py2.6.egg
3
/home/ygamretuta/dev/py/django/lib/python2.6
4
/home/ygamretuta/dev/py/django/lib/python2.6/plat-linux2
5
/home/ygamretuta/dev/py/django/lib/python2.6/lib-tk
6
/home/ygamretuta/dev/py/django/lib/python2.6/lib-old
7
/home/ygamretuta/dev/py/django/lib/python2.6/lib-dynload
8
/usr/lib/python2.6
9
/usr/lib/python2.6/plat-linux2
10
/usr/lib/python2.6/lib-tk
11
/home/ygamretuta/dev/py/django/lib/python2.6/site-packages
12
/home/ygamretuta/dev/py/django/lib/python2.6/site-packages/PIL
13
I am using Ubuntu 10.10 and this is the uname-a output:
JavaScript
1
2
1
Linux ygam-desktop 2.6.35-28-generic #49-Ubuntu SMP Tue Mar 1 14:40:58 UTC 2011 i686 GNU/Linux
2
I am using Python 2.6
I followed the following guides already:
http://appelfreelance.com/2010/06/libjpeg-pil-snow-leopard-python2-6-_jpeg_resync_to_restart/
http://www.jooncode.com/2010/12/02/python-pil-jpeg-resync-restart-error-imaging-module-solve/
Advertisement
Answer
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