unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] Update python-pip to 9.0.1
Date: Thu, 12 Jan 2017 08:44:12 -0800	[thread overview]
Message-ID: <878tqgtehv.fsf@gmail.com> (raw)
In-Reply-To: <87tw98mgj9.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 09 Jan 2017 15:52:58 +0100")

[-- Attachment #1: Type: text/plain, Size: 3840 bytes --]

Hi Ludovic!

Apologies for my delayed answer.

ludo@gnu.org (Ludovic Courtès) writes:

>> From bfd91a59acdf3105505d7dd8483bb9cb97137cbf Mon Sep 17 00:00:00 2001
>> From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
>> Date: Mon, 28 Nov 2016 16:30:07 -0800
>> Subject: [PATCH] gnu: python-pip: Update to 9.0.1
>>
>> * gnu/packages/python.scm (python-pip, python2-pip): Update to 9.0.1.
>
> I applied and expounded the commit log a bit.

Thanks!

>
> One thing which I discovered while testing pip on Guix was that
> depending on how you use Python on Guix the PYTHONPATH differs:
>
>> # PYTHONPATH in an environment
>> $ guix environment python-wrapper
>> [env]$ python3 -c 'import sys; print(sys.path)'
>> ['',
>> '/gnu/store/ar7k7ds90ikxv40a6lif6jv2g39l7mls-profile/lib/python3.5/site-packages',
>> '/gnu/store/b7zbbavbk1jv40b9virwmglck9bdj43a-python-3.5.2/lib/python35.zip',
>> '/gnu/store/b7zbbavbk1jv40b9virwmglck9bdj43a-python-3.5.2/lib/python3.5',
>> '/gnu/store/b7zbbavbk1jv40b9virwmglck9bdj43a-python-3.5.2/lib/python3.5/plat-linux',
>> '/gnu/store/b7zbbavbk1jv40b9virwmglck9bdj43a-python-3.5.2/lib/python3.5/lib-dynload',
>> '/home/maxim/.local/lib/python3.5/site-packages',
>> '/gnu/store/b7zbbavbk1jv40b9virwmglck9bdj43a-python-3.5.2/lib/python3.5/site-packages']
>
> The above command creates an environment containing the dependencies of
> python-wrapper.
>
> Instead, you probably wanted to run this:
>
> $ ./pre-inst-env guix environment --ad-hoc python-wrapper -- python -c
> 'import sys; print(sys.path)'

Right! Thanks for pointing that out.

> substitute: updating list of substitutes from 'https://mirror.hydra.gnu.org'... 100.0%
> The following derivations will be built:
>    /gnu/store/bxr0cw01qhgd9r741a6nnm5zwx3y12rr-profile.drv
>    /gnu/store/l91wf51q5ravikki293baljfx0bacqm8-info-dir.drv
>    /gnu/store/a4mz2l85sc11w6llh56zxlcc1bmfmzsr-ca-certificate-bundle.drv
>    /gnu/store/3z9hsnrwvqw70h0ssxqw0vy5y2dvzcj4-fonts-dir.drv
> ['', '/gnu/store/w63slncr9gyzjrs09n8ls81xac9fs804-profile/lib/python3.5/site-packages', '/home/ludo/.guix-profile/lib/python3.5/site-packages', '/gnu/store/alk9r3rir93pjmv8im20f8xrvv90219z-python-3.5.2/lib/python35.zip', '/gnu/store/alk9r3rir93pjmv8im20f8xrvv90219z-python-3.5.2/lib/python3.5', '/gnu/store/alk9r3rir93pjmv8im20f8xrvv90219z-python-3.5.2/lib/python3.5/plat-linux', '/gnu/store/alk9r3rir93pjmv8im20f8xrvv90219z-python-3.5.2/lib/python3.5/lib-dynload', '/gnu/store/alk9r3rir93pjmv8im20f8xrvv90219z-python-3.5.2/lib/python3.5/site-packages']
>
> … although it doesn’t make much of a difference in this particular case
> since python-wrapper has python as its dependency.
>
>> Conclusion: When using python in a "guix environment", the *system*
>> site-packages directory appears _before_ the *user* site-packages
>> directory in the PYTHONPATH, which is wrong and causes pip to not work
>> as intended. [2]
>
> ‘guix environment’ without --pure adds its own entries to the front of
> the search paths, which is why we observe this behavior.
>

Is this specific to 'guix environment' with --pure vs without --pure?
I'll test it out!

Also, would this behavior be observed for any 3rd
party package management system, say, the one for ruby, or <some>
language? If so maybe we could document this behavior somewhere.

> In most cases this is what we want (we want to create an environment
> that prevails over the user’s profile), but I can see why this is
> problematic here.
>
> I would argue that using ‘pip’ in ‘guix environment’ is a bit convoluted
> anyway, but then again I’m no Python expert.  :-)
>

Yes, it is a bit convoluted. But with environments being so convenient,
I can think that people other than me would attempt this ;)

Thanks for the reply!

Maxim

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2017-01-12 16:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-06 18:41 [PATCH] Update python-pip to 9.0.1 Maxim Cournoyer
2017-01-09 14:52 ` Ludovic Courtès
2017-01-12 16:44   ` Maxim Cournoyer [this message]
2017-01-14 17:43     ` Ludovic Courtès
2017-01-15 17:55       ` Anomalies in Python search-path (was: [PATCH] Update python-pip to 9.0.1) Maxim Cournoyer
2017-01-15 22:10         ` Anomalies in Python search-path Ludovic Courtès
2017-01-16  9:30           ` Hartmut Goebel
2017-01-19 11:48             ` Ludovic Courtès
2017-01-14 21:02 ` Anomalies in Python search-path (was: [PATCH] Update python-pip to 9.0.1) Hartmut Goebel
2017-01-15 19:23   ` Anomalies in Python search-path Maxim Cournoyer
2017-01-16  9:23     ` Hartmut Goebel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878tqgtehv.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).