[Zope] TextImage , PIL installation troubles
Joel Burton
jburton@scw.org
Thu, 1 Mar 2001 12:41:12 -0500 (EST)
On Thu, 1 Mar 2001 walter@pleyer.com wrote:
> Hi folks!
>
> I've been trying to install TextImage for a while now, but apparently
> my PIL setup is wrong.
>
> I can see TextImage in my Products-list, but it only displays the
> following error-message:
> Traceback (innermost last):
> File "/var/zope/lib/python/OFS/Application.py", line 397, in
> import_products
> product=__import__(pname, global_dict, global_dict, silly)
> File "/var/zope/lib/python/Products/TextImage/__init__.py", line 5,
> in ?
> import TextImage
> File "/var/zope/lib/python/Products/TextImage/TextImage.py", line
> 12, in ?
> import PIL.Image
> ImportError: No module named PIL.Image
>
> Can anyone help me with some advice on setting up PIL properly?
PIL is a (semi-standard) Python module, so its all pure Python...
1) Windows or Unix?
In Windows, the standard way seems to be to have Zope use a new
Python install in c:\Program Files\WebSite\bin, unless you changed
the defaults. In Unix, the standard seems to be BYOP (Bring Your Own
Python).
The diff is that to get things working under Zope for Windows, you
need to install it in zope's python, *not* the 'normal' python install
that you may or may not have (c:\ptython15 or c:\python20 or such)
Win: put it in $ZOPE/bin/lib
Unix: install it in your regular ol' pythonpath (/usr/local/lib/python,
or whatever)
2) Need to add to path?
You may have to set the PYTHONPATH arg to find it. PP is an
environmental variable that lists places where libraries could be.
If the above doesn't work, try changing your Zope start script to:
Windows:
SET PYTHONPATH=<whatever_it_was_before_if_anything>;C:\zope\bin\lib\PIL
Unix:
export PYTHONPATH=<whatever>:/usr/local/lib/python/PIL
(the Unix is bash syntax, if you're a csh user, you probably know
to change the 'export')
[ I didn't have to change my path, YMMV ]
Try it out:
c:\Zope\bin\ > python
Python 1.5.2: import PIL
BTW, ExtImage is a great app for wrapping images to handle properties,
cataloging, auto-thumbnails, etc. Some features (thumbnails, etc) require
PIL, which a great reason to install it.
HTH,
--
Joel Burton <jburton@scw.org>
Director of Information Systems, Support Center of Washington