我在尝试让 selftest.py 成功运行的服务器上遇到困难。
我正在尝试让 PIL 1.1.7 与 Python 2.4.4 一起使用(版本是否兼容?)
像这样执行安装时:
# python2.4 setup.py install
running install
running build
running build_py
running build_ext
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version 1.1.7
platform linux2 2.4.6 (#1, Dec 21 2012, 14:54:30)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)]
--------------------------------------------------------------------
*** TKINTER support not available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
*** LITTLECMS support not available
--------------------------------------------------------------------
To add a missing option, make sure you have the required
library, and set the corresponding ROOT variable in the
setup.py script.
To check the build, run the selftest.py script.
running build_scripts
running install_lib
running install_scripts
changing mode of /usr/local/bin/pilconvert.py to 755
changing mode of /usr/local/bin/pilprint.py to 755
changing mode of /usr/local/bin/pilfile.py to 755
changing mode of /usr/local/bin/pilfont.py to 755
changing mode of /usr/local/bin/pildriver.py to 755
creating /usr/local/lib/python2.4/site-packages/PIL.pth
一切看起来都很方便,花花公子。Jpeg 支持可用,一切都很高兴。但是 selftest.py 是另一回事:
# python2.4 /usr/local/src/Imaging-1.1.7/selftest.py
--------------------------------------------------------------------
PIL 1.1.7 TEST SUMMARY rc/Imaging-1.1.7]# yum install libjpeg62-devel zlib1g-devel libfreetype6-devel liblcms1-develp
--------------------------------------------------------------------
Python modules loaded from ./PIL
Binary modules loaded from ./PIL
--------------------------------------------------------------------
--- PIL CORE support ok
*** TKINTER support not installed
*** JPEG support not installed
*** ZLIB (PNG/ZIP) support not installed
--- FREETYPE2 support ok
*** LITTLECMS support not installed
--------------------------------------------------------------------
Running selftest:
*****************************************************************
Failure in example:
try:
_info(Image.open(os.path.join(ROOT, "Images/lena.jpg")))
except IOError, v:
print v
from line #24 of selftest.testimage
Expected: ('JPEG', 'RGB', (128, 128))
Got: decoder jpeg not available
1 items had failures:
1 of 57 in selftest.testimage
***Test Failed*** 1 failures.
*** 1 tests of 57 failed.
我得到可怕的 Jpeg 解码器不可用。
我尝试了各种各样的事情。我将设置更改为指向不起作用的 usr/lib64。我在 usr/lib 中创建了一些符号链接以指向 libjpeg.so 文件,但这也不起作用。我在我们的服务器托管地点与技术人员来来回回,他们不理解这个问题,这就像对着墙说话。我真的被困住了。我唯一没有尝试过的是画中画,但我没有尝试过,因为我不知道它是如何工作的。所以我想避免这种情况。
是否存在兼容性问题或我不太正确的设置?
感谢您的帮助。
- 更新 -
这些天再次解决这个问题,我已经测试了 Centos 5 和 6 32 位,一切都像魅力一样安装,但 64 位我仍然遇到问题。
似乎自检适用于股票 python2.6,但不适用于 python2.4。Pil 1.1.7 与 2.4.4 兼容,但我认为 64 位库存在问题。仍在寻找解决方案。