From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hartmut Goebel Subject: Re: Anomalies in Python search-path Date: Mon, 16 Jan 2017 10:30:59 +0100 Message-ID: <587C92D3.8090705@crazy-compilers.com> References: <8737gw2fqw.fsf@gmail.com> <87tw98mgj9.fsf@gnu.org> <878tqgtehv.fsf@gmail.com> <87shollepw.fsf@gnu.org> <87inpgi4xc.fsf_-_@gmail.com> <871sw4ezz8.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cT3d8-0004EZ-8c for guix-devel@gnu.org; Mon, 16 Jan 2017 04:31:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cT3d3-0002YW-AY for guix-devel@gnu.org; Mon, 16 Jan 2017 04:31:10 -0500 In-Reply-To: <871sw4ezz8.fsf@gnu.org> 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: =?UTF-8?Q?Ludovic_Court=c3=a8s?= , Maxim Cournoyer Cc: guix-devel@gnu.org Am 15.01.2017 um 23:10 schrieb Ludovic Court=C3=A8s: >> > My last reporting that pip was working correctly in non-environment = was >> > wrong because I had failed to logout/login after installing the pyth= on >> > package; after doing so, the behavior is the same as in an environme= nt: >> > the user site location (~/.local/...) comes after site-packages rath= er >> > than before, as would normally be the case. Apparently this is due t= o >> > setting a site-packages location with the environment variable >> > PYTHONPATH, which has precedence over the user site location. > ~/.guix-profile/etc/profile prepends things to the search paths, but > it=E2=80=99s up to the user whether to source it before or after other > definitions have been provided (in .bash_profile or similar). Maxim is talking about how python is processing the paths. The "normal" order is: - $PYTHONPATH (which normaly does not include site-packages) - Python Standard library (not including site-packages) - user's site-packages (~/.local/lib/python3.4/site-packages) - global site-packages (/usr/lib/python3.4/site-packages) The user's site-packages take precedence over the global ones. In Guix we currently use PYTHONPATH to add global site-packages. Since PYTHONPATH parts are put in front of the search list, they take precedence over the user's site-packages. And this behaviour is wrong. --=20 Regards Hartmut Goebel | Hartmut Goebel | h.goebel@crazy-compilers.com | | www.crazy-compilers.com | compilers which you thought are impossible |