Hi Ludovic! Apologies for my delayed answer.
l...@gnu.org (Ludovic Courtès) writes: >> From bfd91a59acdf3105505d7dd8483bb9cb97137cbf Mon Sep 17 00:00:00 2001 >> From: Maxim Cournoyer <maxim.courno...@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
signature.asc
Description: PGP signature