Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
651 views
in Technique[技术] by (71.8m points)

python - PIL - libjpeg.so.8: cannot open shared object file: No such file or directory

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:

libjpeg.so.8: cannot open shared object file: No such file or directory

here is the error run with a python -v interpreter inside the virtualenv

>>> import _imaging
dlopen("/home/ygamretuta/dev/py/django/lib/python2.6/site-packages/PIL/_imaging.so", 2);
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: libjpeg.so.8: cannot open shared object file: No such file or directory

and here are the paths:

/home/ygamretuta/dev/py/django/lib/python2.6/site-packages/distribute-0.6.14-py2.6.egg
/home/ygamretuta/dev/py/django/lib/python2.6/site-packages/pip-0.8.1-py2.6.egg
/home/ygamretuta/dev/py/django/lib/python2.6
/home/ygamretuta/dev/py/django/lib/python2.6/plat-linux2
/home/ygamretuta/dev/py/django/lib/python2.6/lib-tk
/home/ygamretuta/dev/py/django/lib/python2.6/lib-old
/home/ygamretuta/dev/py/django/lib/python2.6/lib-dynload
/usr/lib/python2.6
/usr/lib/python2.6/plat-linux2
/usr/lib/python2.6/lib-tk
/home/ygamretuta/dev/py/django/lib/python2.6/site-packages
/home/ygamretuta/dev/py/django/lib/python2.6/site-packages/PIL

I am using Ubuntu 10.10 and this is the uname-a output:

Linux ygam-desktop 2.6.35-28-generic #49-Ubuntu SMP Tue Mar 1 14:40:58 UTC 2011 i686 GNU/Linux

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/

http://djangodays.com/2008/09/03/django-imagefield-validation-error-caused-by-incorrect-pil-installation-on-mac/

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...