centos - Centos 6 64 位错误 : Jpeg Decoder not Available 的 PIL selftest.py 失败

标签 centos 64-bit python-imaging-library centos6 python-2.4

我在尝试让 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 中创建了一些符号链接(symbolic link)以指向 libjpeg.so 文件,这也没有用。我在我们的服务器托管地点与技术人员来回交流,他们不理解这个问题,这就像在对着墙说话。我真的卡住了。我唯一没有尝试过的是画中画,但我没有尝试过,因为我不知道它是如何工作的。所以我想避免这种情况。

是否存在兼容性问题或我的设置不太正确?

感谢您的帮助。

--更新--

这几天又在研究这个问题 我已经测试了 Centos 5 和 6 32 位并且一切都安装得很好,但是 64 位我仍然有问题。

自测似乎适用于现有的 python2.6,但不适用于 python2.4。 Pil 1.1.7 与 2.4.4 兼容,但我认为 64 位库存在问题。仍在寻找解决方案。

最佳答案

经过大量测试后,这是不可能的。

我确信它可以完成,但将其降级所需的步骤非常密集,以至于很难保证服务器/系统的稳定性。

问题确实出在64位系统上。如果 python 2.4 被编译为 32 位,则 Python-Imagining 将与 python 2.4 一起工作。然而,即使你将 Python-2.4 编译成 32 位,它也很难使用库,因为 Centos 中的所有内容都是为 64 arch 构建的。获取这些额外的库很麻烦,因为 repo 协议(protocol)不包含使其正常工作所需的结构。只是,烦人。绕圈子打猎是不可行的,花在支持这样一个跛行系统上的时间也被浪费了。并可能使系统处于危险之中。

不可以,无法在 64 位计算机上安装适用于 Python 2.4 的 PIL。

关于centos - Centos 6 64 位错误 : Jpeg Decoder not Available 的 PIL selftest.py 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14758456/

相关文章:

c++ - 对 `USER_ERROR__inconsistent_build_configuration__see_dlib_faq_1_' 的 undefined reference

gcc - 安装 pydeep 时命令 'gcc' 失败,退出状态为 1

php - 无法在过度访问者中连接 Memcached

mysql - 无法访问MySQL服务器,不知道root账户的密码

date - 游戏中奇怪的64位时间格式,你能认得出来吗?

python - 内存增长虽然被覆盖

windows - 64 位大型 malloc

Java 64位JDK问题

python - 使用 PIL 显示一个 numpy 数组

python - 在 Python 中将图像处理为棕褐色调