help-guix
[Top][All Lists]
Advanced

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

Re: program prepared with `guix pack` unusable by end users


From: Maxim Cournoyer
Subject: Re: program prepared with `guix pack` unusable by end users
Date: Thu, 27 Oct 2022 12:59:23 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)

Hi,

Csepp <raingloom@riseup.net> writes:

> Wojtek Kosior via <help-guix@gnu.org> writes:
>
>> [[PGP Signed Part:Undecided]]
>> My problem has been solved. It turned out the Python interpreter
>> contained within the pack was finding an older version of `hydrilla`
>> Python package installed in `~/.local/lib/python3.9/site-packages` and
>> that older version was missing the `console_scripts` entry point that
>> was being loaded. It's worth mentioning that Python interpreter gives
>> `~/.local/lib/python3.9/site-packages` priority over the paths that
>> Guix adds to GUIX_PYTHONPATH.
>>
>> The solution was to patch the wrapper script for each of the commands
>> my package provides. Definition of PYTHONNOUSERSITE enviroment variable
>> stops Python from looking at local site packages.

[...]

>> It's worth noting that this problem is not exclusive to `guix pack` or
>> to my particular package. Users of other Python programs could in some
>> circumstances experience similar issues. Which makes me think -
>> shouldn't the default behavior be changed? Perhaps by making Python
>> give paths from `GUIX_PYTHONPATH` priority over those in user site
>> packages directory? Should I report this as a bug to bug-guix@gnu.org?
>>
>> Best,
>> Wojtek

[...]

> IMHO yes, the pack output does not work as expected.  That's the
> definition of a bug.

I disagree.  That Python gives precedence to USERSITE compared to
site-packages and GUIX_PYTHONPATH is by design, so that users can
override system provided libraries such as those by Guix.  It used to be
the other way around, and it caused all sort of problems such as
virtualenv not working as expected on Guix.

-- 
Thanks,
Maxim



reply via email to

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