[Top][All Lists]

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

Re: Down with PYTHONPATH!

From: Ludovic Courtès
Subject: Re: Down with PYTHONPATH!
Date: Fri, 14 Jun 2019 23:29:14 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)


Ricardo Wurmus <address@hidden> skribis:

> here’s a half-baked idea that I think is worth considering: let’s patch
> our Python package to respect GUIX_PYTHONPATH and use GUIX_PYTHONPATH in
> our wrappers.



> So I propose to avoid using PYTHONPATH, which is similarly dangerous as
> LD_LIBRARY_PATH in that it causes incompatible libraries to be loaded.
> Switching to GUIX_PYTHONPATH is not going to be a complete solution
> (because it doesn’t distinguish between different versions of Python),
> but at the very least it will separate Python applications that use Guix
> from Python applications that don’t.  Right now this is not the case and
> people who use Guix for some things but not for others have a really bad
> time and learn to avoid Guix because it sets PYTHONPATH, which breaks
> their other applications.

The reasoning makes sense to me… but wouldn’t it extend to most of the
*PATH variables?  After all, PERL5LIB or even GUILE_LOAD_PATH could lead
to similar issues, no?

AIUI, the problem is more acute in Python because of pip, and because
people are likely to use both pip and Guix, right?

> If we’re feeling lucky we could even introduce GUIX_PYTHON2_PATH and
> GUIX_PYTHON3_PATH to solve the other half of the problem, namely that
> Python 2 applications will load Python 3 libraries (and vice versa).

My gut reaction is that this is a problem for upstream to solve
(GUILE_LOAD_PATH has the same problem, and AFAICS most PATH variables
are unversioned), but OTOH we’re at the forefront here because we can
usefully mix Python 2 and Python 3 things in an environment.


reply via email to

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