Need preferred 'import' format for ReportLab Image module
Hi all, This is of interest to those people using the (excellent) PDF generator, ReportLab <http://www.reportlab.com/> under Zope. As you may know, there is an import conflict with the 'Image' module from PIL and the built in Zope 'Image' module when using ReportLab. The snippet below is from the main ReportLab developer, Andy Robinson.
If it's not too much trouble, that would be very useful for those of us using Zope (the number is growing all the time).
We will try to do this. But which import format does Zope require? 'import Image' of 'import PIL.Image'? And is this some sort of packaged 'PIL-for-Zope'? If it was just PIL on your hard disk, you would have 100% control over the problem just by adding the right directory to your path. Sorry, I'm working all hours and don't have time to download and play with Zope this month. - Andy ------ So, can anyone with a higher 'import' Zope Zen please give me a clue as to how to reply to Andy? In my own reportlab distribution I changed; import Image to from PIL import Image and that seemed ok, but I'd like a 'definitive' answer on this from some bods with Nirvana-level Zen.... BTW, If you're not a reportlab user (open source, free download), then you're missing out - this is terrific software...we have it connected to ZSQL methods and are churning out PDF documents *very* quickly. cheers, Tone
Tony McDonald wrote:
to reply to Andy? In my own reportlab distribution I changed; import Image to from PIL import Image
Well, it sounds right and if it works then it probably is ;-) It probably depends exactly where you install PIL, though, which I haven't done yet :-S cheers, Chris
to reply to Andy? In my own reportlab distribution I changed; import Image to from PIL import Image
Well, it sounds right and if it works then it probably is ;-) It probably depends exactly where you install PIL, though, which I haven't done yet :-S
The Photo product and the ExtImage products do more or less the same - this seems to become the standard way. It would be nice to have one place to put PIL, though. the lib/python/shared directory would be a good place I think. Rik
At 2:37 pm +0200 12/10/00, Rik Hoekstra wrote:
to reply to Andy? In my own reportlab distribution I changed; import Image to from PIL import Image
Well, it sounds right and if it works then it probably is ;-) It probably depends exactly where you install PIL, though, which I haven't done yet :-S
The Photo product and the ExtImage products do more or less the same - this seems to become the standard way. It would be nice to have one place to put PIL, though. the lib/python/shared directory would be a good place I think.
Rik
Is this because you're thinking of the binary releases of Zope? If you're using the reportlab libraries, then you've probably installed them into /usr/local/lib/python1.5/site-packages (ie you're used to using source distributions). If you can do that, you're probably ok with putting PIL into lib/python/shared. So why not have it in site-packages? Or have I missed something obvious (I probably have - it's been a looong day). tone ------ Dr Tony McDonald, FMCC, Networked Learning Environments Project http://nle.ncl.ac.uk/ The Medical School, Newcastle University Tel: +44 191 222 5116 A Zope list for UK HE/FE http://www.fmcc.org.uk/mailman/listinfo/zope
to reply to Andy? In my own reportlab distribution I changed; import Image to from PIL import Image
Well, it sounds right and if it works then it probably is ;-) It probably depends exactly where you install PIL, though, which I haven't done yet :-S
The Photo product and the ExtImage products do more or less the same - this seems to become the standard way. It would be nice to have one place to put PIL, though. the lib/python/shared directory would be a good place I think.
Rik
Is this because you're thinking of the binary releases of Zope?
yes, that's my reference at least ;-)
If you're using the reportlab libraries, then you've probably installed them into /usr/local/lib/python1.5/site-packages (ie you're used to using source distributions). If you can do that, you're probably ok with putting PIL into lib/python/shared. So why not have it in site-packages?
ok, that's a good choice if you're working from source distributions.
Or have I missed something obvious (I probably have - it's been a looong
day). no, you missed nothing, I just thought it would be good to make a remark about this. The point is that the Photo product puts the thing in it's own subdirectory (or so it seems, I haven't used it really) _and_ uses the PIL.pth thing. And PIL comes with a PIL.pth itself. If PIL is used by more products, it is a good idea to put it inone place, be it lib/python/shared or /usr/local/lib/python1.5/site-packages or whatever directory in your Python Path. But note that acoording to the site.py documentation these do not exist in windows or mac installations and that <package>.pth file may contain any directory. Rik
participants (3)
-
Chris Withers -
Rik Hoekstra -
Tony McDonald