I installed Zope 2.1.6, the product called Photo, a full version of Python 1.5.2, and PIL on a RedHat 5.2 system. When I bring up Zope, the product Photo says it is broken (in the Product Management page in the Control Panel). The traceback shows the following: Traceback (innermost last): File "/usr/local/zope/lib/python/OFS/Application.py", line 387, in import_products product=__import__(pname, global_dict, global_dict, silly) File "/usr/local/zope/lib/python/Products/Photo/__init__.py", line 42, in ? import Photo File "/usr/local/zope/lib/python/Products/Photo/Photo.py", line 87, in ? from PIL.Image import BICUBIC, BILINEAR, NEAREST ImportError: No module named PIL.Image I followed the instructions in PIL. I created a directory called site_packages in /usr/lib/python1.5, copied the PIL directory to there (/usr/lib/python1.5/site_packages/PIL), put a PIL.pth file in /usr/lib/python1.5/site_packages which has one line ("PIL") I removed the zope/bin/python file, and changed the start file to use /usr/bin/python Now if I execute python and do this.... Python 1.5.2 (#5, Mar 29 2000, 17:56:25) [GCC 2.7.2.3] on linux2 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
import sys print sys.path ['', '/usr/lib/python1.5/', '/usr/lib/python1.5/plat-linux2', '/usr/lib/python1.5/lib-tk', '/usr/lib/python1.5/lib-dynload']
Why does the /usr/lib/python1.5/site_packages/PIL not show up in the path? Regards, Brian
Brian Burton wrote:
I installed Zope 2.1.6, the product called Photo, a full version of Python 1.5.2, and PIL on a RedHat 5.2 system. When I bring up Zope, the product Photo says it is broken (in the Product Management page in the Control Panel). The traceback shows the following:
[Traceback snipped]
I removed the zope/bin/python file, and changed the start file to use /usr/bin/python
Now if I execute python and do this....
Python 1.5.2 (#5, Mar 29 2000, 17:56:25) [GCC 2.7.2.3] on linux2 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
import sys print sys.path ['', '/usr/lib/python1.5/', '/usr/lib/python1.5/plat-linux2', '/usr/lib/python1.5/lib-tk', '/usr/lib/python1.5/lib-dynload']
Why does the /usr/lib/python1.5/site_packages/PIL not show up in the path?
Heh, I just ran into this same problem a few days ago. For some reason PIL doesn't install a __init__.py (or at least the RPM of it didn't). Check /usr/lib/python1.5/site-packages/PIL for a __init__.py. If it isn't there, then make one with this content: import Image, ImageFile, ImageEnhance, ImageDraw, _imaging, GifImagePlugin, JpegImagePlugin, PngImagePlugin, BmpImagePlugin -- Nick Garcia | ngarcia@codeit.com CodeIt Computing | http://codeit.com
participants (2)
-
Brian Burton -
Nick Garcia