Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use `python3 -m pip` for pip example #1563

Open
brettcannon opened this issue Dec 13, 2016 · 11 comments

Comments

@brettcannon
Copy link

@brettcannon brettcannon commented Dec 13, 2016

I couldn't find any previous issue about this idea, but I was wondering if it was considered to have the pip instructions for each project specify python -m pip instead of pip only? That would be a great way to start moving people towards using the pip tied to the interpreter when they have more than one interpreter installed rather than maybe accidentally running a pip command tied to the wrong interpreter.

@dstufft

This comment has been minimized.

Copy link
Member

@dstufft dstufft commented Dec 14, 2016

One thing I'm not sure about here is whether or not we want to encourage python -m pip. We're kind of a weird spot right now where when pip and python line up, then python -m pip ... is an extra 10 characters to type (and can we tab complete them? I'm not sure...) for a fairly common case and a lot of people react negatively to it as a "this is how you run it by default". The current situation is kind of crummy because we have two different ways to invoke pip (both with -m and with the CLI commands) and people get confused about that. Another possible option I had was one where we reworked pip so it no longer required being installed into each and every environment (so there's no longer like 100 different copy of pips on your typical developer machine) and we added a virtualenv like -p flag.

I do think we probably need to settle on the "one true way" to invoke pip that deals with multiple interpreters and such and start deprecating/removing the other ways and switching things like these little helper scripts to using it.

@brainwane brainwane added this to the Cool but not urgent milestone Dec 7, 2017
@brainwane

This comment has been minimized.

Copy link
Member

@brainwane brainwane commented Dec 7, 2017

@brettcannon Thanks for making the point -- I think this is important, but I hope you don't mind that I'm noting that this issue isn't part of the critical path towards switching PyPI to Warehouse.

@brettcannon

This comment has been minimized.

Copy link
Author

@brettcannon brettcannon commented Dec 7, 2017

@brainwane Not at all! This obviously has nothing to do with getting that pre-production banner of of Warehouse.

@pradyunsg

This comment has been minimized.

Copy link
Member

@pradyunsg pradyunsg commented Mar 4, 2018

I imagine this would need discussion over on distutils-sig at some point but before that, I think that pypa/packaging-problems or pypa/pip would be better places for this discussion?

@brettcannon

This comment has been minimized.

Copy link
Author

@brettcannon brettcannon commented Jun 13, 2019

Is it time to open this can of worms somewhere?

@pradyunsg

This comment has been minimized.

Copy link
Member

@pradyunsg pradyunsg commented Jun 13, 2019

Hehe.

There's a bunch of related discussion at pypa/pip#3164.

I think we have consensus (see starting pypa/pip#3164 (comment)) but I don't think we should go through that much of our "churn budget" right now, especially given the churn from our newer standards.

One of the aims there is that "pip does not provide any CLI wrappers; only supports python -m pip" which makes this more relevant.

@dstufft

This comment has been minimized.

Copy link
Member

@dstufft dstufft commented Jun 13, 2019

Honestly, I'm not a super big fan of invoking pip using -m. I mean, I think it's the best way given how pip currently works, but I think we'd be better off trying to figure out more fundamental ways to change rather than some minor invocation shuffling.

@brainwane

This comment has been minimized.

Copy link
Member

@brainwane brainwane commented Jun 13, 2019

Is that a short term or medium term task, though, @dstufft?

@dstufft

This comment has been minimized.

Copy link
Member

@dstufft dstufft commented Jun 13, 2019

Probably long term? My thinking regarding this has changed since pypa/pip#3164 was first filed, but we probably want to agree on what the long term looks like, before making any short term steps to make sure we don't have to backtrace our steps.

@brettcannon

This comment has been minimized.

Copy link
Author

@brettcannon brettcannon commented Jun 13, 2019

Fair enough. I will then leave this alone while the interface to pip gets hashed out.

@z00sts

This comment has been minimized.

Copy link

@z00sts z00sts commented Nov 17, 2019

For everybody who interested in topic: Brett's post https://snarky.ca/why-you-should-use-python-m-pip/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.