Gentoo Archives: gentoo-user

From: walt <w41ter@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: Python update question
Date: Fri, 02 Mar 2012 22:51:29
Message-Id: jiripo$jto$1@dough.gmane.org
In Reply to: Re: [gentoo-user] Python update question by Dale
1 On 03/02/2012 11:24 AM, Dale wrote:
2
3 > But if I tell eselect to set it to 3 something then that is what the
4 > system will try to use right?
5
6 "The system" isn't granular enough (I've been dying to use that geek-
7 speak phrase :) when discussing portage, which is only part of a gentoo
8 "system".
9
10 List the files in sys-apps/portage and you'll see that none of them go
11 in /usr/lib/pythonN.N/site-packages like mere ordinary python packages.
12 They go instead in /usr/lib/portage, which is independent of your python
13 version.
14
15 However, try this trick:
16
17 #head -1 /usr/lib/portage/bin/emerge
18 #!/usr/bin/python3
19
20 You can see from that I've installed portage to use python3, even though:
21
22 #eselect python list
23 Available Python interpreters:
24 [1] python2.7 *
25 [2] python3.1
26
27 I still have my "system" python set to 2.7 like most of us, I suspect.
28
29 At this point, the portage package obeys the setting of the python3
30 useflag to decide which python to use and I have my python3 useflag
31 set, so portage announces "fixing shebangs" at the end of the emerge,
32 and that's where the #!/usr/bin/python3 comes from.