[Distutils] The future of invoking pip

Nathaniel Smith njs at pobox.com
Mon Nov 9 20:35:08 EST 2015

On Mon, Nov 9, 2015 at 5:20 PM, Ionel Cristian Mărieș
<contact at ionelmc.ro> wrote:
> On Tue, Nov 10, 2015 at 3:05 AM, Nathaniel Smith <njs at pobox.com> wrote:
>> So apparently if you use 'python -m venv' to create a new *venv* while
>> inside a *virtualenv*, then it seems to complete successfully but
>> leaves you with a venv that doesn't contain pip. At least on my
>> machine (up-to-date Debian testing).
> How is this relevant? Are you trying to suggest that `pip -p path/to/python`
> would exhibit the same class of bugs and failures `virtualenv -p
> path/to/python` has?

Uh... no, no idea what that even means. It was just intended as an
example of how it's possible to end up in weird situations where 'pip'
and 'python' mean different things, even though I seemingly did
everything right. Evidence for Chris's assertion that "This really
does happend with newbies, and it really is a problem, trust me on
that.". (And maybe a small cry for help, since this really did bite me
just now.)

In this situation, if pip's default for finding the python environment
were to search the path for 'python' instead of using sys.executable,
then it wouldn't matter whether pip were installed into the venv or
not, it would have automatically targeted the active environment. And
'python -m pip' would at least have failed cleanly with a sensible
error message. Current pip just silently targets the wrong

> I'm not saying it wouldn't but how much of that `no pip in venv` bug is a
> virtualenv issue or a problem with the design of a pip launcher or
> standalone pip? It seems to me that it's a bit irrelevant, but correct me if
> you're not using Ubuntu (were venv is broken in ludicrous ways). Plus
> virtualenv is broken in it's own way (bootstrapping, see this and this) ...

I'm using Debian, as noted in the text you quoted :-). No idea if
Debian's venv is also broken in ludicrous ways (though I wouldn't be
shocked if you told me it was -- I love Debian but I know their Python
team<->distutils communication is not always the greatest...)


Nathaniel J. Smith -- http://vorpus.org

More information about the Distutils-SIG mailing list