【发布时间】:2010-11-06 12:38:47
【问题描述】:
PIL setup.py 构建的一些背景知识:
--------------------------------------------------------------------
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 解释器导入 Image 和 _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
所以 _imaging 在使用 python 解释器时可用,但由于某种原因在其他情况下没有正确导入。
在过去的几个小时里,我一直在寻找解决这个问题的方法,但还没有找到解决办法。我错过了一些愚蠢的事情吗?或者有什么关于它为什么不起作用的想法?
提前致谢!
另外:我知道http://effbot.org/zone/pil-imaging-not-installed.htm,但这只是说明错误并没有提供解决方案。
编辑:我一直在窥探,看来导入 _imagingmath 是问题所在。我做了 python -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.]
【问题讨论】:
标签: python django ubuntu python-imaging-library imaging