背景從PIL setup.py建立一個位:PIL不會導入_imaging C模塊中:「***的_imaging C模塊中未安裝」
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version 1.1.7
platform linux2 2.6.2 (release26-maint, Apr 19 2009, 01:58:18)
[GCC 4.3.3]
--------------------------------------------------------------------
*** TKINTER support not available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
*** LITTLECMS support not available
--------------------------------------------------------------------
這是的Ubuntu 9.04安裝。
我只需要PIL就可以讓Django上傳和調整各種不同格式的圖像。不幸的是,它目前不能處理JPEG。執行PIL的selftest.py後,想出了這個:
*** The _imaging C module is not installed
我試圖導入圖像,並使用Python解釋器-v(兩者合作)_imaging ...
>>> from PIL import Image
import PIL # directory PIL
# PIL/__init__.pyc matches PIL/__init__.py
import PIL # precompiled from PIL/__init__.pyc
# PIL/Image.pyc matches PIL/Image.py
import PIL.Image # precompiled from PIL/Image.pyc
[繼續成功相當長的一段]
>>> import _imaging
dlopen("/usr/local/lib/python2.6/dist-packages/PIL/_imaging.so", 2);
import _imaging # dynamically loaded from /usr/local/lib/python2.6/dist-packages/PIL/_imaging.so
使用Python解釋器時,那麼_imaging是可用的,但由於某種原因沒有被進口在其他情況正常。
我一直在尋找這個問題的解決方案,在過去的幾個小時,並沒有任何接近找到一個。我錯過了一些愚蠢明顯的東西嗎?或者有什麼想法,爲什麼它不工作?
在此先感謝!
另外:我知道http://effbot.org/zone/pil-imaging-not-installed.htm,但只是演示錯誤,並沒有提供解決方案。
編輯:我一直在窺探,看來導入_imagingmath是問題。我做了蟒蛇-vv selftest.py看到它被打破了,這是怎麼回事:
dlopen("/usr/local/lib/python2.6/dist-packages/PIL/_imagingmath.so", 2);
import _imagingmath # dynamically loaded from /usr/local/lib/python2.6/dist-packages/PIL/_imagingmath.so
*** The _imaging C module is not installed
# clear __builtin__._
[etc. etc. etc.]
這給我的錯誤:「E:找不到包的libjpeg」。我確實已經安裝了libjpeg62 - 是否相當於? – 2010-11-06 13:03:45
你有libjpeg62-devel嗎? – 2010-11-06 13:25:16
不,我有libjpeg62和libjpeg62-dev。 – 2010-11-06 13:31:05