CentOS自检下的PIL安装正常,但jpeg不工作

CentOS自检下的PIL安装正常,但jpeg不工作,centos,jpeg,python-imaging-library,Centos,Jpeg,Python Imaging Library,我通过执行build、build_ext-I和install,在使用Python2.7的CentOS 6.2上构建并安装了PIL。我必须更改库路径,以便提供所有支持。 当我运行selftest.py时,它表示一切正常,并且提供了所有支持(尤其是JPEG) 运行打开jpeg、添加内容并保存的程序时,我会收到以下错误: File "/opt/python2.7.2/lib/python2.7/site-packages/PIL/Image.py", line 401, in _getencode

我通过执行build、build_ext-I和install,在使用Python2.7的CentOS 6.2上构建并安装了PIL。我必须更改库路径,以便提供所有支持。 当我运行selftest.py时,它表示一切正常,并且提供了所有支持(尤其是JPEG)

运行打开jpeg、添加内容并保存的程序时,我会收到以下错误:

  File "/opt/python2.7.2/lib/python2.7/site-packages/PIL/Image.py", line 401, in _getencoder
    raise IOError("encoder %s not available" % encoder_name)
IOError: encoder jpeg not available
我的程序在其他系统上运行良好,当我将其更改为png时,它在centOS机器上运行良好。我用python2.7运行了所有命令,并且已经尝试重新安装PIL


简而言之:在安装PIL之前,它成功地在自检中运行,但在安装之后,它就不再工作了。

我在

1/ Call 'pip install -I pil --no-install' to download and unpack the PIL source into your 
build directory;
2/ Get into your build directory and edit setup.py;
3/ Find the line that says 'add_directory(library_dirs, "/usr/lib")' (line 214 here);
4/ Add the line 'add_directory(library_dirs, "/usr/lib/i386-linux-gnu")' afterwards;
5/ Call 'pip install -I pil --no-download' to finish the installation.