[Python-ideas] High time for a builtin function to manage packages (simply)?

Andrew Barnert abarnert at yahoo.com
Thu Sep 10 10:26:20 CEST 2015

On Sep 9, 2015, at 21:32, Chris Angelico <rosuav at gmail.com> wrote:
>> On Thu, Sep 10, 2015 at 1:25 PM, Stephen J. Turnbull <stephen at xemacs.org> wrote:
>> Nathaniel Smith writes:
>>> That seems more productive in the short run than trying to
>>> get everyone to stop typing "pip" :-).
>> FWIW, I did as soon as I realized python_i_want_to_install -m pip
>> worked; it's obvious that it DTRTs, and I felt like I'd just dropped
>> the hammer I'd been whacking my head with.
> If the problem with this is the verbosity of it ("python -m pip
> install packagename" - five words), would there be benefit in blessing
> pip with some core interpreter functionality, allowing either:
> $ python install packagename
> or
> $ python -p packagename
> to do the one most common operation, installation? (And since it's new
> syntax, it could default to --upgrade, which would match the behaviour
> of other package managers like apt-get.)
> Since the base command is "python", it automatically uses the same
> interpreter and environment as you otherwise would. It's less verbose
> than bouncing through -m. It gives Python the feeling of having an
> integrated package manager, which IMO wouldn't be a bad thing.
> Of course, that wouldn't help with the 2.7 people, but it might allow
> the deprecation of the 'pip' wrapper. Would it actually help?

What about leaving the pip wrapper, but having it  display a banner telling people to use python -m pip (and maybe suggesting they add an alias to their profile, if not Windows) and then do its thing as it currently does. (Maybe with some way to suppress the message if people want to say "I know what I'm doing; if my PATH is screwy I'll fix it".)

If we also add the python -p, it can instead suggest that if version >= (3, 6).

That seems like an easier way to get the message out there than trying to convince everyone to spread the word everywhere they teach anyone, or deprecating it and leaving people wondering what they're supposed to do instead.

More information about the Python-ideas mailing list