我在嘗試使selftest.py成功運行時遇到困難。對於Centos 6 64位PIL selftest.py失敗錯誤:Jpeg解碼器不可用
我試圖讓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文件,這也不起作用。我在我們的服務器託管地點與技術人員來回走動,他們不理解這個問題,就像在牆上聊天。我很困難。我沒有嘗試的唯一的事情是PiP,但我沒有嘗試,因爲我不知道它是如何工作的。所以我想避免這種情況。
是否存在兼容性問題或設置我只是不太對勁?
謝謝你的協助。
--UPDATE--
工作在這個問題上再次,這些天 我測試過的Centos 5 & 6 32位和安裝的一切就像一個魅力,但64位,我仍然有問題。
似乎自測與股票python2.6一起使用,但不與python2.4一起使用。 Pil 1.1.7與2.4.4兼容,但我認爲64位的庫存在問題。仍在尋找解決方案。
「(版本是否兼容?)」查看[PIL主頁](http://www.pythonware.com/products/pil/),我看到一個專門用於2.4的下載鏈接。這是你安裝的版本嗎?編輯:哎呀,這只是Windows,所以我猜不是。但至少表明它可以在2.4上運行。 – Kevin