From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxim Cournoyer Subject: Re: [PATCH] Update python-pip to 9.0.1 Date: Thu, 12 Jan 2017 08:44:12 -0800 Message-ID: <878tqgtehv.fsf@gmail.com> References: <8737gw2fqw.fsf@gmail.com> <87tw98mgj9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRiUC-0008Hg-RI for guix-devel@gnu.org; Thu, 12 Jan 2017 11:44:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRiU8-0000hv-1L for guix-devel@gnu.org; Thu, 12 Jan 2017 11:44:24 -0500 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") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Ludovic! Apologies for my delayed answer. ludo@gnu.org (Ludovic Court=C3=A8s) writes: >> From bfd91a59acdf3105505d7dd8483bb9cb97137cbf Mon Sep 17 00:00:00 2001 >> From: Maxim Cournoyer >> 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.z= ip', >> '/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.o= rg'... 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/s= ite-packages', '/home/ludo/.guix-profile/lib/python3.5/site-packages', '/gn= u/store/alk9r3rir93pjmv8im20f8xrvv90219z-python-3.5.2/lib/python35.zip', '/= gnu/store/alk9r3rir93pjmv8im20f8xrvv90219z-python-3.5.2/lib/python3.5', '/g= nu/store/alk9r3rir93pjmv8im20f8xrvv90219z-python-3.5.2/lib/python3.5/plat-l= inux', '/gnu/store/alk9r3rir93pjmv8im20f8xrvv90219z-python-3.5.2/lib/python= 3.5/lib-dynload', '/gnu/store/alk9r3rir93pjmv8im20f8xrvv90219z-python-3.5.2= /lib/python3.5/site-packages'] > > =E2=80=A6 although it doesn=E2=80=99t make much of a difference in this p= articular 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] > > =E2=80=98guix environment=E2=80=99 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 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=E2=80=99s profile), but I can see why this is > problematic here. > > I would argue that using =E2=80=98pip=E2=80=99 in =E2=80=98guix environme= nt=E2=80=99 is a bit convoluted > anyway, but then again I=E2=80=99m 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEJ9WGpPiQCFQyn/CfEmDkZILmNWIFAlh3slwACgkQEmDkZILm NWKfqw/9FYRCK2hO8zxRwsAA3G00ZsQNO5Rv0f3XgNa1dVL4k3crCBHTHizigciU 1rMA7F9viCNYVczQCyta4y8GXQDMVquNijp1a7AxqveZVnjiipXISWtjvS/b5bws Frv+b81N3VRSYXqXbkRC/7Soa/Amb6uzMZcic2bF2wBrsgan4evwIgqDWF7AUTkb NQ6fp7x8CQ3G8HFaI+adXvVcG/fvspezAIwueLRfhSITmAqqQ8OsHE/AjNccPpXr bf2vDw08dKSjP+dPvV1SWv4gSsUUvKByiRMuY2hYf6WqYmRVLDJmZgF1F89HbID3 c43G2uOk/AveJkvPQXhZVx2J9MknM1wKLaX5zb0q02XfmwgRj5FkntePgKZ8Y8Rx KapquXnXfIYPEJBwvJ+Ap5PVzZWn8t9c85Sc7g5z8JGyFQrS7vZwKfo16IDR9IFT kg5DHgA5+su80yy9yOG6VeI9KBWVYkNvYlzqpyk4G42h/zxsziZERlvf8ifrQr59 N/HXW14jSSY0veR8lQDlKBS6m4/7a6t3tOovgtGfJPUPGWyiY9AWmBVOV/ep/8Sf FmG7EKgDBLzD3Y06oKYk1etB0OtTAqYlEo6SlFTVm8jf3/AIJymSOpSwRS9x7MIG Lidaj03i6EZL+PMRiIfUybcOrDqdSctXhvxOTry4hOpnl5vav0A= =YYpb -----END PGP SIGNATURE----- --=-=-=--