PIL, Python and CGI

Sascha Ferley Sascha.Ferley at infineon.net
Mon Jun 24 03:30:38 CEST 2002


Hi Richard
Thanks for replying back to me, this thing has been driving me nuts for a
while now. Anyways, i removed the try/catch block from the Image.py lib,
and checked the error output:

Traceback (most recent call last):
  File "/export/server/web/CPSC461/cgi-bin/interfce.py", line 15, in ?
    print Image.open(urlretrieve(sourcePath, '/tmp/img1')[0]).histogram()
  File "/usr/local/lib/python2.2/site-packages/PIL/Image.py", line 577, in
histogram
    self.load()
  File "/opt/sfw/lib/python2.2/site-packages/PIL/ImageFile.py", line 126,
in load
    self.load_prepare()
  File "/opt/sfw/lib/python2.2/site-packages/PIL/ImageFile.py", line 180,
in load_prepare
    self.im = Image.core.new(self.mode, self.size)
AttributeError: 'module' object has no attribute 'core'

Any new Ideas?
Sascha




On Mon, 24 Jun 2002, Richard Jones wrote:

> On Mon, 24 Jun 2002 09:37, Sascha Ferley wrote:
> > strange reason it can't find the _imaging extention..
> > It is sort of strange that it wouldn't pick it up then.. any more ideas?
>
> I'd say there's a chance that the _imaging module has linked to a shared
> library and the web server doesn't have the appropriate lib dir in its
> LD_LIBRARY_PATH. That'd cause an ImportError.
>
> Unfortunately, PIL is swallowing the exact error - try removing the try/except
> around the "import _imaging" and see what the real error is.
>
>
>    Richard
>
>








More information about the Python-list mailing list