Gentoo Archives: gentoo-user

From: Khanh Nguyen <knguyen@××××××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Installing python packages for different versions
Date: Sun, 14 Jun 2009 11:02:51
Message-Id: 20090614105841.GA23804@requisitus.net
In Reply to: [gentoo-user] Installing python packages for different versions by Florian Philipp
1 Hi Florian.
2
3 ** (Sat, Jun 13, 2009 at 06:44:27PM +0200) Florian Philipp wrote:
4 > Hi!
5 >
6 > This is actually a follow-up for my thread "Trouble installing Plone".
7 >
8 > Following scenario: I have packages which run on python-2.4 and other
9 > packages which work with 2.5. Zope is a prominent example of the 2.4 gang.
10 >
11 > The problem: When I emerge a python package, for example
12 > dev-python/imaging, it is only installed in the
13 > /usr/lib/python-2.*/site-packages directory of the python version which
14 > is currently enabled by eselect.
15 >
16 > Naturally, this is the most recent version: 2.5. However, as soon as a
17 > python-2.4 package depends on one of these other packages, it just
18 > doesn't work because it expects them in /usr/lib/python-2.4/site-packages.
19 >
20 > How am I supposed to work around this?
21
22 With regards to Zope and Plone, use python2.5 but have python2.4 installed
23 and use buildout[1] to fetch Zope/Plone.
24
25 Zope needs python2.4 with PIL. A quick fix, is to either symlink or
26 copy /usr/lib/python-2.5/site-packages/PIL* to /usr/lib/python-2.4/site-packages/
27
28 You also need dev-libs/libxml2 (with python) and symlink/copy to
29 /usr/lib/python-2.4/site-packages/{libxml2*,drv_libxml2}
30
31 When Python dependencies are in place, you can use buildout to fetch Zope/Plone
32 For this you need dev-python/setuptools.
33
34
35 PS! When following the guide[1], remember to bootstrap and buildout with python2.4.
36 eg: python2.4 bootstrap.py && python2.4 ./bin/buildout
37
38 PSS! If you use sudo and have a restrictive umask for your user, you need to lower
39 it to eg 022 before creating the buildout enviroment.
40
41 > Regards,
42 >
43 > Florian Philipp
44 >
45
46 Good luck :)
47
48 [1] http://plone.org/documentation/tutorial/buildout
49 --
50 Khanh Nguyen

Replies

Subject Author
Re: [gentoo-user] Installing python packages for different versions Florian Philipp <lists@××××××××××××××××××.net>