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
Open

Use python3 -m pip for pip example #1563

brettcannon opened this issue Dec 13, 2016 · 11 comments
Labels
documentation needs discussion a product management/policy issue maintainers and users should discuss

Comments

@brettcannon
Copy link
Contributor

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
Copy link
Member

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
Copy link
Contributor

@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
Copy link
Contributor Author

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

@brainwane brainwane added the needs discussion a product management/policy issue maintainers and users should discuss label Jan 30, 2018
@pradyunsg
Copy link
Contributor

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
Copy link
Contributor Author

Is it time to open this can of worms somewhere?

@pradyunsg
Copy link
Contributor

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
Copy link
Member

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
Copy link
Contributor

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

@dstufft
Copy link
Member

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
Copy link
Contributor Author

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

@z00sts
Copy link

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
Labels
documentation needs discussion a product management/policy issue maintainers and users should discuss
Projects
None yet
Development

No branches or pull requests

5 participants