From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: Re: Down with PYTHONPATH! Date: Fri, 14 Jun 2019 23:29:14 +0200 Message-ID: <875zp7j1p1.fsf@gnu.org> References: <87muikr3bq.fsf@mdc-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:42479) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbtlD-0005JO-0x for guix-devel@gnu.org; Fri, 14 Jun 2019 17:29:24 -0400 In-Reply-To: <87muikr3bq.fsf@mdc-berlin.de> (Ricardo Wurmus's message of "Fri, 14 Jun 2019 10:14:33 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ricardo Wurmus Cc: guix-devel@gnu.org Hello! Ricardo Wurmus skribis: > here=E2=80=99s a half-baked idea that I think is worth considering: let= =E2=80=99s patch > our Python package to respect GUIX_PYTHONPATH and use GUIX_PYTHONPATH in > our wrappers. Oh! [...] > 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=E2=80=99t distinguish between different versions of Pyt= hon), > but at the very least it will separate Python applications that use Guix > from Python applications that don=E2=80=99t. Right now this is not the c= ase 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=E2=80=A6 but wouldn=E2=80=99t 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=E2=80=99re 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=E2=80=99re at the forefront here because we c= an usefully mix Python 2 and Python 3 things in an environment. Thanks, Ludo=E2=80=99.