How to install PIL with Zope. I'd lile to using Photo Product on Linux. But I'm in troubled by installation of PIL with Zope2.5.1(Binary). I guess it is because I use both python1.5.2 from Redhat(7.2) and python2.1.3 from Zope(2.5.1). when I try import _imaging using PIL compiled with each python, there are different solution below: # /opt/zope/bin/python Python 2.1.3 (#1, Apr 15 2002, 11:13:45) [GCC 2.7.2.3] on linux2 Type "copyright", "credits" or "license" for more information.
import _imaging WARNING: Python C API version mismatch for module _imaging: This Python has API version 1010, module _imaging has version 1007.
# /usr/bin/python Python 1.5.2 (#1, Jul 5 2001, 03:02:19) [GCC 2.96 20000731 (Red Hat Linux 7.1 2 on linux-i386 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
import _imaging
Do you have any good solution ? Yujis
Yuji Sato wrote:
I guess it is because I use both python1.5.2 from Redhat(7.2) and python2.1.3 from Zope(2.5.1). when I try import _imaging using PIL compiled with each python, there are different solution below:
You should just install the version of PIL that is compatible with your Zope Python, under the Zope Python. Forget that the 1.52 version is on the machine at all. It doesn't matter, as long as you don't try to install Pil under it ;-) regards Max M -- "Sorry I would Really Like To Help More On This Project, But Am To Busy Doing Paid Work On A Tight Deadline" Max M
On Tue, Aug 06, 2002 at 10:47:25AM +0200, Max M wrote:
You should just install the version of PIL that is compatible with your Zope Python, under the Zope Python. Forget that the 1.52 version is on the machine at all. It doesn't matter, as long as you don't try to install Pil under it ;-)
This may be slightly off topic, but has anyone managed to compile PIL 1.1.3 on Solaris8? It works like a charm on Linux, but when I try to compile it on Solaris I get loads of errors using gcc: <unknown> 0xcc8 libImaging/libImaging.a(Draw.o) <unknown> 0xccc libImaging/libImaging.a(Draw.o) <unknown> 0xcf0 libImaging/libImaging.a(Draw.o) <unknown> 0xcf4 libImaging/libImaging.a(Draw.o) <unknown> 0xd10 libImaging/libImaging.a(Draw.o) <unknown> 0xd18 libImaging/libImaging.a(Draw.o) <unknown> 0xd1c libImaging/libImaging.a(Draw.o) and so on ad nausea. Thanks in advance for any help, Uwe -- Uwe Schuerkamp Tel: +49 (0)5241 / 80 10 66, FAX: / 806 23 38 Uwe.Schuerkamp@nionex.net Nionex GmbH, IWN5 (http://www.nionex.de/) GnuPG KeyID: 5887047D Avenwedder Str. 55, 33311 Guetersloh GnuPG Fingerprint: 2E 13 20 22 9A 3F 63 7F 67 6F E9 B1 A8 36 A4 61
May I ask you some more question ? I'd like to install PIL, because I want to use "Photo and Photo Folder Product". The configuration of my server is like this: Zope Location /opt/zope Python Location /opt/zope/bin/python "libjpeg.a" and "libz.a" are situated under /usr/lib. I did ./configure and make under the /libImagina. Then I run setup.py at the ../ /opt/zope/bin/python setup.py build /opt/zope/bin/python setup.py install So, PIL and PIL.pth are copied in here: /opt/zope/lib/python2.1/site-packages But it seems that there was no processing to libImagina.a Is it necessary to copy it in somewhere manualy ? If it's necessary, in where ? I added "Photo Folder" and Image to my "Zope Site" . But I run "View" DTML Method, I have error message like below: Error Type: NameError Error Value: global name 'tag' is not defined Traceback (innermost last): File /opt/zope/lib/python/ZPublisher/Publish.py, line 150, in publish_module File /opt/zope/lib/python/ZPublisher/Publish.py, line 114, in publish File /opt/zope/lib/python/Zope/__init__.py, line 159, in zpublisher_exception_hook (Object: img) File /opt/zope/lib/python/ZPublisher/Publish.py, line 98, in publish File /opt/zope/lib/python/ZPublisher/mapply.py, line 88, in mapply (Object: view) File /opt/zope/lib/python/ZPublisher/Publish.py, line 39, in call_object (Object: view) File /opt/zope/lib/python/OFS/DTMLMethod.py, line 127, in __call__ (Object: view) File /opt/zope/lib/python/DocumentTemplate/DT_String.py, line 473, in __call__ (Object: view) File /opt/zope/lib/python/DocumentTemplate/DT_Util.py, line 159, in eval (Object: tag(display=REQUEST.get('display', 'small'), border=1, cookie=1)) (Info: REQUEST) File <string>, line 2, in f NameError: (see above) regards Yujis.
Yuji Sato wrote:
So, PIL and PIL.pth are copied in here: /opt/zope/lib/python2.1/site-packages
I am rather rusty on Linux, but on Win I need to manually copy '_imaging.pyd' and '_imagingtk.pyd' into the <PYTHON>/DLLs/ directory for PIL to work. regards Max M -- "Sorry I would Really Like To Help More On This Project, But Am To Busy Doing Paid Work On A Tight Deadline" Max M
Yuji Sato writes:
... So, PIL and PIL.pth are copied in here: /opt/zope/lib/python2.1/site-packages
But it seems that there was no processing to libImagina.a Is it necessary to copy it in somewhere manualy ? No, "*.a" files are static libraries only need for linking.
PIL contains a shared object. If this is linked against a dynamic library (they have names of the form "*.so" and you can use the command "ldd" to check which shared objects (that's what the "so" stands for) are required), then it must be either at a standard place or reachable via "LD_LIBRARY_LATH". A candidate may be "libjpeg.so".
I added "Photo Folder" and Image to my "Zope Site" . But I run "View" DTML Method, I have error message like below:
Error Type: NameError Error Value: global name 'tag' is not defined ... File /opt/zope/lib/python/OFS/DTMLMethod.py, line 127, in __call__ (Object: view) File /opt/zope/lib/python/DocumentTemplate/DT_String.py, line 473, in __call__ (Object: view) File /opt/zope/lib/python/DocumentTemplate/DT_Util.py, line 159, in eval (Object: tag(display=REQUEST.get('display', 'small'), border=1, cookie=1)) (Info: REQUEST) File <string>, line 2, in f NameError: (see above) This does not look like a PIL installation problem.
You should have a DTMLMethod named "view" which calls "tag". "tag" is an "Image" method but apparently, there is not image on the DTML namespace at the moment. Dieter
hi yujis. Yuji> But it seems that there was no processing to libImagina.a Yuji> Is it necessary to copy it in somewhere manualy ? Yuji> If it's necessary, in where ? I think it is no problem. You may have a dynamic library _imaging.so instead of libImaginga.a. here's my install log. ##### after unziped archive # cd libImaging # ./configure ##### if you don't have xv, make check would be failed, but you don't care. # make check # make # cd .. # make PYTHON=python2 -f Makefile.pre.in boot # make # PYTHONPATH=.:./PIL ; export PYTHONPATH ##### check library # python2
import _imaging import Image ##### move library in the PYTHONPATH # cp PIL.pth /usr/lib/python2.1/site-packages # mkdir /usr/lib/python2.1/site-packages/PIL # cp *.so PIL/* /usr/lib/python2.1/site-packages/PIL
-- Sumiya Sakoda <sakoda@toyoake.or.jp>
Thank you Max, Dieter and Sumiya. I compiled PIL again. # cd libImaging # ./configure # make # # cd .. # /opt/zope/bin/python setup.py build # /opt/zope/bin/python setup.py install # #/opt/zope/bin/python
import Image import _imaging # /opt/zope/lib/python2.1/site-packages/PIL /opt/zope/lib/python2.1/site-packages/PIL.pth /opt/zope/lib/python2.1/site-packages/PIL/_imaging.so
Then restart Zope From ZMI Debug Infomation at /Control_Panel/DebugInfo #I got to know for the first time about DebugInfo today. sys.path: /opt/zope/lib/python/ZopeZODB3 /opt/zope/lib/python /opt/zope /opt/zope /opt/zope/lib/python2.1 /opt/zope/lib/python2.1/plat-linux2 /opt/zope/lib/python2.1/lib-tk /opt/zope/lib/python2.1/lib-dynload /opt/zope/lib/python2.1/site-packages /opt/zope/lib/python2.1/site-packages/PIL # cat /opt/zope/lib/python/Products/Photo/__init__.py """Photo and Photo Folder""" __version__ = '1.2.3' from Photo import Photo, manage_addPhotoForm, manage_addPhoto from PhotoFolder import PhotoFolder, manage_addPhotoFolderForm, manage_addPhotoF older def initialize(registrar): registrar.registerClass( Photo, constructors = (manage_addPhotoForm, manage_addPhoto), icon = 'www/photo.gif' ) registrar.registerClass( PhotoFolder, constructors = (manage_addPhotoFolderForm, manage_addPhotoFolder), icon = 'www/photofolder.gif' ) I added "Photo" and checked to "Pregenerate Displays". Error Type: AttributeError Error Value: superValues Traceback (innermost last): File /opt/zope/lib/python/ZPublisher/Publish.py, line 150, in publish_module File /opt/zope/lib/python/ZPublisher/Publish.py, line 114, in publish File /opt/zope/lib/python/Zope/__init__.py, line 159, in zpublisher_exception_hook File /opt/zope/lib/python/ZPublisher/Publish.py, line 98, in publish File /opt/zope/lib/python/ZPublisher/mapply.py, line 88, in mapply (Object: manage_addPhoto) File /opt/zope/lib/python/ZPublisher/Publish.py, line 39, in call_object (Object: manage_addPhoto) File /opt/zope/lib/python/Products/Photo/Photo.py, line 655, in manage_addPhoto File /opt/zope/lib/python/OFS/ObjectManager.py, line 267, in _setObject (Object: Zope) File /opt/zope/lib/python/Products/Photo/Photo.py, line 631, in manage_afterAdd (Object: test.jpg) File /opt/zope/lib/python/Products/ZFS/objectHandlers.py, line 41, in manage_afterAdd (Object: test_thumbnail.jpg) File /opt/zope/lib/python/Products/ZFS/objectHandlers.py, line 194, in manage_afterAdd File /opt/zope/lib/python/Products/ZFS/objectHandlers.py, line 130, in _changeAttr AttributeError: (see above) I added "Photo" and no checked to "Pregenerate Disply". Then 1. "Settings" Pregenerate Displays is checked. 2. "Display" submit of Regenerate All. It's a works! Why is a difference in two operation? regards Yujis.
The problem was solved. Although I installed ZFS in the trial, when I removed this, it's working. Thank you. File /opt/zope/lib/python/Products/ZFS/objectHandlers.py, line 41, in manage_afterAdd (Object: test_thumbnail.jpg) File /opt/zope/lib/python/Products/ZFS/objectHandlers.py, line 194, in manage_afterAdd File /opt/zope/lib/python/Products/ZFS/objectHandlers.py, line 130, in _changeAttr AttributeError: (see above)
participants (6)
-
Dieter Maurer -
Max M -
Sumiya Sakoda -
Uwe Schuerkamp -
Yuji Sato -
Yuji Sato