The package dev-libs/libxml2 installs python bindings for python-2.2. Zope doesn't use that python version, instead it uses the old one, python-2.1, which doesn't have libxml2 python bindings in its site-packaes. Some zope products (like CMFOODocument) require to import libxml2 and thus cannot work. Binary bindings do not work (besides, what binaries? it's Gentoo!). The tarball from xmlsoft doesn't compile. How to install libxml2 (and libxslt) python bindings from the source code into site-packages of python2.1? Reproducible: Always Steps to Reproduce: Expected Results: "import libxml2" and "import libxslt" must work in Zope.
*** Bug 17835 has been marked as a duplicate of this bug. ***
*** Bug 17836 has been marked as a duplicate of this bug. ***
Can you make /usr/lib/python2.1/site-packages a symlink to /usr/lib/python2.2/site-packages? Does that allow Zope to begin working?
Nope, symlinks (as well as copiing) doesn't work - module libraries are linked with librarties and thus must work with the proper one. I've tried and got "reference" errors.
B/c Python is SLOTted in Gentoo, I am proposing to make some sort of "python-lib-install" procedure, which will take a list of *ALL* installed pythons, and then install the lib with *EACH* of them. In a similar way "python-lib-uninstall" must exist.
By the way, despite the fact that today this bug is bothering mostly b/c of the fact that Zope is using non-default slotted version of python, the bug itself is more general than just Zope related. Any Python based application, if it is requires explicit version of python (not the latest one, but something like python-2.1.*) *AND* that application requires some python libraries to be installed, is under risk to be broken, b/c those python libraries will be installed on the (default) python slot which is not the slot that is used by that application. Please, try to avoid hacking, as later it will hit back when that library has to be upgraded.
Created attachment 10803 [details] dev-libs/libxml2-py21/libxml2-py21-2.5.6.ebuild Does this work? --kutsuya
For the given project I need both xml2 and xslt and your attachment doesn't solve xslt for me. So, I cannot say if your ebuild can solve xml2 separately.
When I need xml2 and xslt ONLY for python-2.1 then I do these steps: [code] emerge dev-lang/python/python-2.1.3-r1.ebuild emerge dev-libs/libxml2 emerge dev-libs/libxslt emerge python [/code] However if you upgrade (or just re-emerge) xml2 or xslt now then it will uninstall xml2 and xslt files from /usr/lib/python2.1/site-packages That's why when I need xml2 and xslt on both pythons then I do this: [code] emerge dev-lang/python/python-2.1.3-r1.ebuild emerge dev-libs/libxml2 emerge dev-libs/libxslt mkdir /tmp/xp21 cp /usr/lib/python2.1/site-packages/*xml2* /tmp/xp21 cp /usr/lib/python2.1/site-packages/*xslt* /tmp/xp21 emerge python emerge dev-libs/libxml2 emerge dev-libs/libxslt mv /tmp/xp21/* /usr/lib/python2.1/site-packages [/code] I's a dirty trick but it works until someone from python/gentoo developers will fix it finally.
with zope 2.7 this won't be a problem anylonger since it will require python 2.3.3, and i don't think we'll come up with a solution until then