guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: installing python 2 and python 3 in the same profile


From: Ricardo Wurmus
Subject: Re: installing python 2 and python 3 in the same profile
Date: Sun, 11 Mar 2018 12:10:09 +0100
User-agent: mu4e 1.0; emacs 25.3.1

Pjotr Prins <address@hidden> writes:

> On Wed, Mar 07, 2018 at 08:50:48AM +0100, Ricardo Wurmus wrote:
>> Hi Guix,
>>
>> with the introduction of the collision avoidance feature that prevents
>> you from installing different variants of the same package into a
>> profile we made it impossible to install “python” and address@hidden into
>> the same profile.
>
> I am happy with this idea. Maybe guix can give an informative message
> in the case of Python.
>
> Generally, mixing Python2 and 3 in one profile makes no sense.

Obviously, I strongly disagree :)

On my CentOS and Fedora machines at work both versions are installed
(with the system package manager) and nobody complains.  I can conjure
up a Python 2 environment by calling “python2” and a Python 3
environment by calling “python3” or “python”.  Neither variant will load
up modules for the other variant — unlike the behaviour on Guix.

Even in Guix we allow these packages to be added to the same environment
with “guix environment --ad-hoc” – and there are no collisions, because
upstream made the effort to ensure that these packages don’t provide
files of the same names.

It is an unnecessary restriction to *prevent* users from installing
Python 2 and 3 interpreters into the same profile.  Any errors we see
with mixing 2 and 3 is due to a bug in Guix which is due to our use of
PYTHONPATH.

In large environments Python 2 and 3 modules and interpreters can
peacefully coexist as long as the tools use the appropriate names for
the interpreters (“python2” or “python” for Python 2, “python3” for
the interpreter for Python 3).

In other places in Guix we don’t even prevent users from doing things
that are generally ill-advised (e.g. the use of LD_LIBRARY_PATH); why
would we prevent a perfectly valid use-case when it comes to different
versions of Python?

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net





reply via email to

[Prev in Thread] Current Thread [Next in Thread]