公益诉讼——libjpeg.so。8:无法打开共享对象文件:没有这样的文件或目录

时间:2021-11-07 08:02:39

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 v8, PIL 1.1.7和导入_imaging在系统Python上工作,但是在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

下面是在virtualenv中使用python -v解释器运行的错误

>>> 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:

我正在使用Ubuntu 10.10,这是unam -a输出:

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

我使用的是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://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://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/

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

2 个解决方案

#1


20  

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

请参阅这里的解释:为什么Python不能找到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

一个快速修复是添加包含libjpeg.so的目录。8你/etc/ld.so.配置文件,然后运行ldconfig

#2


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::

此外,如果您正在进行本地Python安装,您还可以使用LD_LIBRARY_PATH环境变量控制会话级别上的动态链接:

 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/)

这样你就不能破坏你的操作系统本身,即使是偶然的。(它会发生:http://opensourcehacker.com/2011/08/31/zend-server-installation-potentially-kills-your-ssh/)

#1


20  

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

请参阅这里的解释:为什么Python不能找到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

一个快速修复是添加包含libjpeg.so的目录。8你/etc/ld.so.配置文件,然后运行ldconfig

#2


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::

此外,如果您正在进行本地Python安装,您还可以使用LD_LIBRARY_PATH环境变量控制会话级别上的动态链接:

 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/)

这样你就不能破坏你的操作系统本身,即使是偶然的。(它会发生:http://opensourcehacker.com/2011/08/31/zend-server-installation-potentially-kills-your-ssh/)