[Python-ideas] Looking for input to help with the pip situation

Steve Barnes gadgetsteve at live.co.uk
Wed Nov 15 01:13:11 EST 2017

>>> We still have to deal with the fact that basically every Unix
>>> environment is "advanced" in the above sense (the python2/python3
>>> split). I don't have a solution for that (other than "upgrade to
>>> Windows" ;-)).
>> Provide the "py" command on linux and mac. And make it the default
>> recommended way in the documentation.
> +1 from me.

How about update pip so that, from the command line it can accept pretty 
much the same syntax as the py launcher:

  - "python -m pip operation ..." all use the same python as is running 
the pip module.

  - "pip -X[.Y][-32|-64] operation ..." tries to find a python matching 
-X[.Y][-32|-64] and if it succeeds executes "python -m pip operation 
..." with that python, (if it doesn't find a matching python is should 
fail with a sensible error message and possibly list the valid python 

"pip operation ..." searches the available python contexts and, if there 
is only one, (or in a venv), calls "python -m pip operation ..." using 
it but, if there is more than one candidate, (or in not in a venv), 
tells the user that they have more than one python and need to specify 
which, listing the options.

"pip -0" searches the available pythons and lists the available contexts.

Ideally the list contexts operations would differentiate between user 
space and system contexts and display them suitably based on the current 
user privileges.

This would:
  - maintain the current behaviour as much as possible,
  - not break all of the existing examples in the wild & literature
  - avoid trying to introduce a new launcher command on Mac/Linux,
  - propagate reasonably quickly, as people are already fairly used to 
being prompted to update pip,
  - Automatically propagate to the default pip as long as it was back 
ported to at least 2.7, possibly further.
  - Allow users who do need to support multiple python installations to 
do so, (I am one of those).
  - Does not require updates to python itself.

Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect 
those of my employer.

This email has been checked for viruses by AVG.

More information about the Python-ideas mailing list