guix-devel
[Top][All Lists]
Advanced

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

Re: Guix's python has pip's user dir in its loadpath


From: Maxim Cournoyer
Subject: Re: Guix's python has pip's user dir in its loadpath
Date: Fri, 30 Jun 2023 23:13:55 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Hi,

宋文武 <iyzsong@envs.net> writes:

> edk@beaver-labs.com writes:
>
>> Dear Guix devs,
>>
>> While working around this bug:
>>
>> https://issues.guix.gnu.org/63912
>>
>> I found that guix's Python will load anything in
>> .local/lib/python3.10/site-packages/ over any installed package in the
>> current profile. This makes pip-installed package overshadow guix's.
>>
>> I'm not sure this is desirable behavior. What I was expecting was for
>> the host system's python packages to be completely ignored.
>
> Hello, I think this is a well-known issue according to PEP 668:
> https://peps.python.org/pep-0668/

Agreed, I think this works as designed: the Guix-installed dependencies
appear as *system* dependencies on the sys.path (see 'python -m site'),
and USER_SITE (which is ~/.local/lib/python3.10/site-packages) must have
precedence over it for locally user-installed packages to be able to
override the system packages.

That's for example necessary for virtualenvs to work as designed (it
used to be that virtualenvs were near useless, with the Guix-provided
dependencies taking precedence on the ones installed in a virtualenv).

-- 
Thanks,
Maxim



reply via email to

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