guix-devel
[Top][All Lists]
Advanced

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

Re: Anomalies in Python search-path (was: [PATCH] Update python-pip to 9


From: Maxim Cournoyer
Subject: Re: Anomalies in Python search-path (was: [PATCH] Update python-pip to 9.0.1)
Date: Sun, 15 Jan 2017 09:55:27 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Hi!

address@hidden (Ludovic Courtès) writes:

> Hello!
>
> Maxim Cournoyer <address@hidden> skribis:
>
>> address@hidden (Ludovic Courtès) writes:
>
> [...]
>
>>> ‘guix environment’ without --pure adds its own entries to the front of
>>> the search paths, which is why we observe this behavior.
>>>

After more testing, the Python search-path we form is always problematic
for pip since the system site-packages will always appear in front of the
user site location (~/.local/...).

My last reporting that pip was working correctly in non-environment was
wrong because I had failed to logout/login after installing the python
package; after doing so, the behavior is the same as in an environment:
the user site location (~/.local/...) comes after site-packages rather
than before, as would normally be the case. Apparently this is due to
setting a site-packages location with the environment variable
PYTHONPATH, which has precedence over the user site location.

All of these precedence rules ared defined by the module site.py which
comes with Python. It can print information about the Python search
paths with:

$ python -m site

Normally the user site-packages location should come before any other
site-packages location so that user installed Python packages can take
precedence over packages visible at the system level (or in our profile
in the the case Guix).

>>
>> Is this specific to 'guix environment' with --pure vs without --pure?
>
> Without ‘--pure’.  Conversely, ‘--pure’ clears the environment
> variables altogether:
>
>   
> https://www.gnu.org/software/guix/manual/html_node/Invoking-guix-environment.html
>
>> 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.
>
> What would you add to the document of ‘guix environment’?  It seems
> quite clear to me at first sight.
>

I've re-read the documentation about it and yes, it is quite clear about
what it does. I'll revisit any problems with environments later, after
the root problem (which lies in the way we manage the Python search
paths in our Python package definition/python build system) is fixed.

Thanks for you time, and for Guix!

Maxim

Attachment: signature.asc
Description: PGP signature


reply via email to

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