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 |