Gentoo Archives: gentoo-user

From: Ralph Seichter <m16+gentoo@×××××××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] how to set python version for one user
Date: Tue, 10 Jul 2018 14:12:24
Message-Id: b92de023-2784-96ba-f7c2-7f0490d00f86@monksofcool.net
In Reply to: [gentoo-user] how to set python version for one user by pat@xvalheru.org
1 On 10.07.2018 10:23, pat@××××××××.org wrote:
2
3 > I need to set specific python version to a user and I don't want to
4 > set it up for whole system. Is it possible?
5
6 I can't tell if by "set it up" to have Python binaries available for
7 only one user, or if you want one user to use a different Python version
8 from other users, with multiple Python versions potentially available to
9 all users, which would be then "Gentoo way".
10
11 If you have, for example, Python 2.7 and 3.6 installed, you can use
12 "eselect python set ..." to configure the default Python for most users.
13 For individual users, I recommend a Python virtual environment. You can
14 use the 'virtualenv' module for both Python 2.7 and 3.x, but since Python
15 3.5 the built-in 'venv' module is recommended.
16
17 I know soft links to a specific Python version were recommended here,
18 but based on my experience I strongly discourage that. Your special user
19 will need more than just the binaries, and a venv is definitely the more
20 robust and versatile way to go.
21
22 -Ralph