我無法使用PIL,因爲它無法找到我的libjpeg!Python PIL找不到我的「libjpeg」
首先,我安裝了PIL默認。而當我跑了selftest.py
,它給了我:
IOError: decoder jpeg not available 1
items had failures: 1 of 57 in
selftest.testimage
***Test Failed*** 1 failures.
*** 1 tests of 57 failed.
於是,我跟着聯機說明更改PIL的setup.py
到
JPEG_ROOT = "/usr/lib"
因爲當我locate libjpeg
,這就是我得到:
locate libjpeg
/usr/lib/libjpeg.so.62
/usr/lib/libjpeg.so.62.0.0
/usr/lib64/libjpeg.so.62
/usr/lib64/libjpeg.so.62.0.0
/usr/share/doc/libjpeg-6b
/usr/share/doc/libjpeg-6b/README
/usr/share/doc/libjpeg-6b/usage.doc
/var/cache/yum/base/packages/libjpeg-6b-37.i386.rpm
/var/cache/yum/base/packages/libjpeg-6b-37.x86_64.rpm
所以,我再次運行setup.py install
...並做了selftest.py
。 而我仍然有同樣的錯誤!
謝謝! FWIW,這就是我所做的(在一個64位盒子上):'sudo yum install zlib-devel.x86_64 libjpeg-devel.x86_64 freetype-devel.x86_64'然後'sudo pip install pil'(這需要你有pip軟件包管理器已經安裝。) – DPlusV 2011-04-26 06:35:39