-
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
Define all old pip entrypoints #7498
Comments
I agree with this as a stopgap measure, but I'm a strong -1 on retaining such "legacy" entry points indefinitely (unless we change our official position on "no supported API"). Personally, I would rather include a warning right now, saying something along the lines of "you are calling the wrong internal entry point for pip (possibly as a result of using an old wrapper script)". We can tidy up the message, and/or find a better long-term solution, later, but I feel that we should have something from the start. The long-term solution will be hard to identify, as most of the time the failing wrappers appear to be distro-supplied, or the result of users with limited command line knowledge misunderstanding concepts like |
Alternative solution: #3164. This could be handled as a phased approach:
It would obviously need a long deprecation period, but I'm fine with that. In the short term, any issues with wrappers failing can be handled by simply advising the user to switch to |
I’m a little skeptical wrt deprecating the pip entrypoint. The main source of the problem here is entrypoints from Linux distributors. I kind of wonder whether they would honour pip removing entrypoints, or go on to generate their own anyway. We wouldnt solve much of the problem if they do (and maybe creating more since there would then be two different entrypoint flavours in the market). |
Note: You mean "wrapper" rather than "entrypoint" here, but your point is valid. I've been very careful as a Windows user to avoid mentioning distros, but as you raised it, I think it's relevant. Many of the issues we see with the To be fair, though, pip's policy has always been to leave the system pip to the distro (although user installs are a sticking point here). But many users don't follow that advice as well as we'd like - not least because doing so (as far as I can tell) needs a reasonable understanding of how If we deprecated the pip wrapper, we could at least say to anyone using a wrapper "either reproduce the issue using |
I agree with making this a stop-gap solution (I'd assumed that was the case, since that's basically how I was personally viewing this).
IMO, we should consider reaching out to distros, to get them to fix their wrappers -- in their current distro releases as bug fixes, or in the next "major" version. That would help inform the length of this deprecation period. |
+1. Does anyone have a good means of doing this (and of tracking it, we should monitor responses and progress on this, and link from here)? |
Is this actually a problem with distro wrappers? I assumed that the distro wrappers were consistent with the system-managed pip and the issue in most cases was either:
None of which I think are distro issues. |
Maybe you're right. But the whole point of having this issue at all is that we don't want to categorise these problems as user issues (after all, we're putting a lot of effort into working round the fact that some users don't understand how The point of involving the distros is (as far as I can see) that they are better able to help users with general "command line UX" issues. Maybe they won't want to, and maybe they are stricter in their view that knowing how to use the command line is the user's problem. But at least we can ask. Maybe this is something we should be referring to the funded work on pip's UX that I believe is under consideration. I've no idea where that is up to right now, but I'd assume that the UX specialists who would be involved in that would have good insight into this sort of thing. |
Big thanks to @chrahunt that I will not need to face this issue again and again on multiple systems and installations. 👍🎉 |
For others wanting to try this locally before official release – this does the trick The warning is very confusing to me, because I actually just updated the pip package. I did nothing wrong, still I see the warning. Pip is basically warning that it uses pip... 😕 Anyway, good move towards having this definitely fixed. 👍 |
Hi @oldium, can you explain what you mean about the warning being confusing? What is your current understanding of the situation given what was output by pip? We can always improve it. |
Hi, I will illustrate it on an example: #> pip --version
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
pip 20.0.dev0 from C:\Users\oldium\AppData\Roaming\Python\Python38\site-packages\pip (python 3.8) I have latest python 3.8.1, pip during installation of some package wrote to me that there is a newer version. Ok, I updated pip (I updated to latest master), but now pip complains with much bigger warning that there is something wrong. Also the requested version output is unreadable because of this. I find it really useful to have |
@oldium What's the output of the following commands for you?
|
#> where.exe pip
C:\Python38\Scripts\pip.exe
C:\Users\oldium\AppData\Roaming\Python\Python38\Scripts\pip.exe Note: I updated
Annoying is that when I use admin rights (not everybody has them) and add my user's AppData Python38 folder to the beginning of the system PATH environment variable, this breaks with next release of Python39, because I would have to manually update the system PATH again (and remember that I have to do it). And I expect that once I will not be ready, the That was Windows. Ubuntu 18.04 adds During past several years I have not found a good solution to this problem, neither on Windows and neither on Linux. The simplest would be if Why is |
The 'main' function was moved between pip 19.2.3 and 19.3, which causes '--pyprof' build to fail with (at least) pip 19.3 and 19.3.1: Traceback (most recent call last): File "setup.py", line 37, in <module> pipmain(["install"] + required_packages) TypeError: 'module' object is not callable A permanent solution for this might require rewriting the '--pyprof' install section to use 'python -m pip', but this change just adjusts the import to tolerate the 19.3 change. See: - pypa/pip@09fd200 - pypa/pip#7498 - pypa/pip#7499
What's the problem this feature will solve?
Tons of users are experiencing problems related to #5599, as evidenced by the traffic that we're getting to related issues (past 2 weeks):
This probably leads to a lot of negative feelings not just for pip, but the Python packaging ecosystem in general.
Describe the solution you'd like
Move the current entrypoint from
pip._internal.main:main
topip._internal.cli.main:main
(or some other location).Create a function for every known past entrypoint:
pip._internal.main:main
pip._internal:main
pip:main
At the very least the functions should invoke the correct current pip entrypoint. This alone would prevent a lot of needless suffering and should be easy to implement and test.
Later we could also consider printing a warning, but I'd rather handle that as a separate issue since this is useful on its own.
Alternative Solutions
Additional context
sys.exit(main()) TypeError: 'module' object is not callable
#7205The text was updated successfully, but these errors were encountered: