TextImage , PIL installation troubles
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? Thanx Walter
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
To use PIL with ExtFile (ExtImage, actually) I installed the PIL code in e:/program files/zopehome/bin/lib/site-python/ and then created a PIL.pth file in the bin/ folder with the following contents: e:/program files/zopehome/bin/lib/site-python e:/program files/zopehome/bin/lib/site-python/PIL The two directory entries were needed because some code accesses the Image module as 'PIL.Image' and other as just 'Image', if I recall correctly.
On Thu, 1 Mar 2001 walter@pleyer.com wrote:
I've been trying to install TextImage for a while now, but apparently my PIL setup is wrong. ... ImportError: No module named PIL.Image
-- Fred Yankowski fred@OntoSys.com tel: +1.630.879.1312 Principal Consultant www.OntoSys.com fax: +1.630.879.1370 OntoSys, Inc 38W242 Deerpath Rd, Batavia, IL 60510, USA
participants (3)
-
Fred Yankowski -
Joel Burton -
walter@pleyer.com