-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Deprecate pip, pipX, and pipX.Y #3164
Comments
i like the move from pip to _pip, |
The other expense is that if we ever want to make a public API we're either limited to having a single namespace (whatever is in Of course, we may never make a public API in which case, the point is moot. |
Don't underestimate the power of that first point. The intertia is high: lots of tools will assume |
-1 on removing pip I would have to change all of my deployment scripts. On Tue, Oct 6, 2015, at 08:16 AM, Cory Benfield wrote:
Links: |
Yea, completely agree. I essentially assume that we should not have a defined removal date (and possibly never) and just have it log a message to stderr. |
I don't think that will work. Just printing annoying warnings with no defined "your shit will break no later than X" date doesn't really help: people will just ignore the warnings. I think if you want to do this you should decide a date (possibly one far away, but still). One possible date to start the discussion: when the last RHEL LTS release with Python 2.6 stops being supported (that's very far away still, but worth discussing). |
I don't think it makes sense to deprecate (not talking about removal any time soon) |
This is good idea. |
That's November 30, 2020 for the end of RHEL 6 Production 3 phase. They have a super special extended life cycle beyond that, but perhaps we could just target 2020 and if we roll around to 2020 and Python 2.6 is still somehow in wide support, we push it back further. |
Another alternative would be to stop requiring that pip execute in the same Python environment that it is installing things into... |
To be honest, I'm not sure how |
For that particular idea the main benefit would be that you would only have to upgrade pip once. |
That much is true, the flip side of that is it makes it (somewhat) harder to support versions of pip older than what pip itself supports, since the installs are no longer independent (or you'll need to keep around an older copy installed somewhere else). On the other hand, pip could more easily drop support for running the main It doesn't address the fact that |
I think @sYnfo wants to comment on this more than I do, since I no longer maintain Python in Fedora/RHEL. |
Ah, that's right, I forgot. Sorry! |
(But I personally think that even if these are removed, we'll still provide them on distribution level in form that is best for the set of Python interpreters that we ship; at least that was my first idea when I read the proposal... We have a general policy for Python executables that mandates this in Fedora.) |
The inertia issue is huge, and I don't think we should fight it directly. Rather, we should switch the documentation to use the "python -m pip" form, and make that form official PyPA policy (by which I mean we take pains to use that form consistently in whatever we post, etc). Maybe offer PRs for the install documentation of well-known projects to switch them to the new form. We can worry about formally deprecating and/or removing the scripts once the |
I think my success criterion is making this the incantation that people get from StackOverflow. Shoot for the moon, etc etc. I think publishing a linkable intent-to-deprecate message with a rationale may help convince third-party maintainers to accept documentation PRs. The messaging here is tricky, because deprecating |
I think the only real alternative is Daniel's suggestion. I think the current situation sucks and I can't really think of a way to save the attempt to manage pip versions using a suffix or prefix or anything that doesn't end up actually specifying which interpreter you want to run under. |
I'm +1 for deprecation—it seems to make a whole lot of sense from upstream point of view and I don't see any issue this could cause downstream. In Fedora this would mean shipping all the binaries during the deprecation period, as we do now; and not shipping them at all afterward. Perfect sync with upstream, hopefully. :) I'll make sure all the Fedora docs get updated, when this goes official. ( @bkabrda If I understand the guidelines correctly, they only mandate shipping all the MAJOR.MINOR executables iff there are any executables in the first place, this issue seems to be about removing the pip executables entirely, right? ) Also +1 to either keeping pip or using python -m pip.main with python 2.6. |
A couple of points that haven't come up:
|
I'm not big on the idea, but I don't think I've ever run pip outside of virtualenv, which is usually activated into my current shell, so the extra typing doesn't gain me anything (I'm selfish!). Of course, if it's not activated, I probably have to type a lot more than that anyway... How would people feel about making an exception for virtualenvs? There's no mystery for which python it is using, but then again it might be too confusing to have it work differently between for virtualenv and the system install, so I'm feeling pretty humble about its quality as a suggestion. I'm also not sure there's a good solution for checking that. Also,
Does this really come up often? I'm curious how you're distinguishing between them if so, since I didn't think python would normally install itself any more specific than by the pythonX.Y name (and unless they have different prefixes, sounds like it would also try to share site-packages anyway). |
Oh, I guess that does apply having multiple 3.4.0 installs too, but then it seems like you'd definitely be using full paths to distinguish whether you're using "pip" or "python -m pip", but since you're using full paths anyway, the argument against having extra wordiness goes away. |
I may be a little disconnected here, but why not replace
Or a script that was akin to this to be installed into That way we don't lose Also not sure if that solves the problems you're facing, just my $0.02. |
@erikrose A virtual environment makes the issue harder to hit, but I think that it's still possible. My gut tells me that new users (the ones most likely to get tripped up by this) are probably not going to be religiously using virtual environments (if they're using them at all). @rschoon I'm not sure exactly how often the 3.4.0 and 3.4.3 thing comes up. I know that it's not super unusual on OSX since you have system provided Python sitting in |
Basically, because it's super confusing if you're doing something like running |
it feels like a loss for virtual environments to lose a basic as for real pythons I guess I wouldn't mind seeing a more exact |
-1 on deprecating For a start, you want to look at why we have this problem, and is it analogous to anyone else? It comes from having and allowing multiple pythons on the one running system. So system package managers do not have this problem, because for instance, you don't (can't) run debian jessie and debian wheezy live at the same time on one system; so it doesn't need to manage a I also want to look at the issue from the POV of majority python users. Note that this has become a real pain point mostly (or more-so) for people with more than 2 pythons installed. Otherwise The other big source of pain is when someone merely tries to install a new python over a previous existing one, but the story for the entire environment being migrated to the new one (or "taking over the old one") isn't there. In that case I want to make the distinction that this is the install story's fault, not the existence of multiple pythons. For instance someone hoping to "install a new python!" but not getting it on their path. Even uninstalling the old python, might do nothing about giving them the environment they want (the new python on their path). Also note that while the number of users collecting problems with managing Now with that in mind, here's solutions I like:
I especially believe implementing the last two points above, would remove a lot of average user-problems in relation to this issue. In many cases they would be empowered to know the problem and solution themselves. |
I still think removing pipX and pipX.Y would be worthwhile. I'm ambivalent about the pip command itself. It is convenient, when it does the right thing. And I've never had any problems with it myself. But it is also the cause of a lot of "why didn't pip do the right thing" questions. I think my position is that I don't have the guts to do it myself, but I'd be fine if someone else wants to do it. As far as abstract "churn budget" questions go, I simply don't think we have the information to make that call objectively - neither the impacts nor the benefits seem sufficiently measurable to me. Is there anywhere in the docs where we still mention these commands? Maybe all we should do is add a note to the docs saying:
While we're at it, we should definitely get PyPI changed: |
FWIW, I still think that |
I mean, if one of our primary concerns is that users get confused when plain @dstufft Where would the "central" pip installation live then? I mean, we could totally make pip into a zipapp -- I'd be fine with that -- but it's not clear to me how we'd migrate to something like that; such that they don't have 12 million pip copies on disk. :) |
This problem interfaces deeply with Linux distributions FWIW, so the soonest we'd actually see genuine improvements from any of this would be... like... 5 years from now. :) |
There could be instructions to run |
Wait wait wait -- don't read OP -- see #3164 (comment) for the current proposal for this. |
Um, I thought I did...? In the comment you quoted I was trying to say shouldn't the PyPI banner suggest |
@pradyunsg I'll be honest in that I never had a 100% fully formed plan, but the way I have envisioned the transition going is that, at least at the start, we don't try to change the fact that there's a billion copies of pip laying around. We probably drop Add in the At that point we can just start socializing the use of Eventually at some point we could possibly drop That more or less fully handles every case where someone currently uses One solution is to just say that we don't support that anymore, deprecate it and push people to use the Another option is to have a small shim script that is basically just (untested): import sys
import os
os.execvp("pip", sys.argv + ["-p", sys.executable]) Another thing to consider is the behavior of the default Another option would be to have it always default to There are a number of ways we could go about selecting what the default is when no At some point yearsinto the future, we could even start shipping pip as a zip app (or a PyOxidizer app, which then wouldn't even require Python to be installed), and stop installing it by default into virtual environments. That would drastically reduce the number of pip's installed on a user's machine, at a minimum it would reduce it to just the ones installed globally (so on Windows, probably 1 per Python, on macOS maybe the same, on Linux probably just 1 total). We could maybe even be intelligent and try to reduce that down to 1 total. I think this ultimately ends up way better off for pip's users. A big problem with It also means things like creating virtual environments can be drastically sped up, because we no longer need to install pip into every single one of them, since pip can just sit outside of it and install into one. It also reduces user annoyance on things like the upgrade warning where people swap around between virtual environemnts and end up getting the upgrade nag randomly. It also means that, in theory, pip itself can narrow it's supported versions of Python easier. This would be because you end up with two "parts" of pip, the part that does most of the logic, then the part that exists just to shell into the target environment and get information out. These don't have to support the same set of Pythons, so you could say pip itself only targets the latest Python while it can target a wider array of Pythons. This probably wouldn't be practical without using PyOxidier or so to bundle Python itself with pip so not really a big thing, but just an example of something this would possibly unlock. |
If we can make a In fact, why not leave this issue parked for now, and in the meantime work on getting |
Coolieo then. That's a plan. |
I really don't want to remove |
Just to clarify, removing |
If I understand the discussion correctly I don’t think the intention is to remove |
I don't think that |
Oh, just to be clear, I think |
Oh yea, gotcha. I don't think we're looking to remove I'm also not super active here so take whatever I say with a grain of salt :) I just happened to notice this thread and figured I'd mention what I thought should be done, and let folks still working on things regularly decide what they felt about it. |
FWIW, another major advantage of adding a |
I just had a 5 hour fight with problems mentioned in this Issue. I am using:
Being inside the virtual environment myenv which again I created and activated with Miniconda, now typing To work around this, I followed an advice found at https://adamj.eu/tech/2020/02/25/use-python-m-pip-everywhere/ and thus I added Not sure if this is a good solution, but for now I got my stuff working. I wanted to share my experience as well as that article. |
Circling back round to this (thanks @pradyunsg for reminding me to re-read it, there's recent comments here I'd forgotten about).
Footnotes
|
One additional thought. The semantics of So on reflection, I'd prefer not to set misleading expectations by including |
I am sure there’s a big group of experimented devs who consistently use virtual environments and run scripts in their simplest form, i.e. Personally I look forward to managing a single pip with the zipapp method, but I will certainly have a symlink so that I’m still typing |
Now that pip has a |
Agreed, although I don't like the |
Does |
Currently, people are regularly running into problems over confusion about which particular Python a particular invocation of pip is going to manage. There are many cases where what Python a particular invocation of
pip*
is going to invoke is unclear:pip3 install --upgrade pip
will overwritepip
and possibly switch it from pointing to 2.7 to 3.5.pip3
isn't specific enough, you might have 3.4 and 3.5 installed.pip3.4
isn't specific enough, you might have 3.4.0 and 3.4.1 installed.pip3.4.0
isn't specific enough, you might have multiple copies of 3.4.0 installed in various locations.pip-pypy
? What if we have two versions of PyPy?pip-pypy2.6
? What if we have PyPy and PyPy3?pip-pypy-2.6
andpip-pypy3-2.6
?).Overall, it's become increasingly clear to me that this is super confusing to people. Python has a built in mechanism for executing a module via
python -m
. I think we should switch to using this as our preferred method of invocation. This should completely eliminate the confusion that is caused whenpython
andpip
don't point to the same version of Python, as well as solve the problem of what do you call the binary on alternative implementations.In addition to the confusion, we also have the fact that
pip install --upgrade pip
doesn't actually work on Windows because of problems with the.exe
file being open. Howeverpython -m pip install --upgrade pip
does work there.I see only three real downsides:
pip
and this will be churn for those.For the first of these, I think the answer is to just have a very long deprecation cycle, in the order of years. I wouldn't even put a specific date on it's removal, I'd just add the warnings and re-evaluate in the future. Luckily we've shipped support for
python -m pip
for quite some time, so it won't be something that people need to deal with version differences (mostly).The second of these I don't really have a great answer for, I think that 10 extra letters probably isn't that big of a cost to pay for the reduced confusion and the default answer working on Windows. We could possibly offer a recipe in the docs to restore
pip
,pipX
, andpipX.Y
via shell aliases.This last item is the biggest sticking point for me. As far as I know, Python 2.6 still has far too many users for us to drop it since, as of 6 months ago, it was still ~10% of the traffic on PyPI (source). The problem with Python 2.6 is that it only supports
-m
when the target is a module not a package. I see four possible solutions to this:pip*
on Python 2.6.pipcli.py
that people can invoke likepython -m pipcli
instead ofpython -m pip
.pip/
to_pip/
and makepip.py
.python -m pip.__main__
.I don't really like the
pipcli
idea, the other three all have pros and cons, but I think I personally live with either not deprecatingpip*
on Python 2.6 and/or documenting that it needs to be invoked as ``python -m pip.main on Python 2.6).What do the @pypa/pip-developers think?
The text was updated successfully, but these errors were encountered: