[Distutils] The future of invoking pip

Donald Stufft donald at stufft.io
Mon Nov 9 08:34:53 EST 2015


On November 9, 2015 at 8:26:50 AM, Paul Moore (p.f.moore at gmail.com) wrote:
> On 9 November 2015 at 12:46, Wayne Werner wrote:
> > My experience(s) with the latest IPython is that it's freaking magic - in
> > a good way :)
>  
> Nice :-) Maybe pip could learn something useful from how the IPython
> guys do that.
> Paul

It’s not likely to be a great option. It essentially just takes /usr/bin/ipython and if the ``VIRTUAL_ENV`` variable is defined it munges sys.path so that it also adds the ``site-packages`` from the virtual environment. This means that it totally ignores —no-site-packages because the “outside” Python sys.path is still there.

The ``-p`` flag in my PoC works by munging the sys.path, but the difference is that it’s adding something like /usr/bin/pip to the sys.path (which is a zip file) which doesn’t otherwise pollute the sys.path with other random crap from within the site-packages. It’d be trivial to have the ``-p`` flag default to something that just automatically takes into account a virtual environment though and python -m pip would implicitly automatically take a virtual environment into account.

-----------------
Donald Stufft
PGP: 0x6E3CBCE93372DCFA // 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA




More information about the Distutils-SIG mailing list