-
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
The pipX.Y console script is set to the Python version used to build the wheel instead of the one used to install the wheel #8010
Comments
Your observation is correct. The wheel specification does not allow post-installation hooks, so this is the best pip can do. pip actually carry special logic in its wheel installation logic, so it will replaces I’m going to close this since the pip maintainers are aware of the solution, and there really isn’t a way to magically fix this. The best pip can do for this is to remove those entry points entirely (a la #3164), but unfortunately that would make a complete different bunch of people very very angry :-) |
Noted. Still (my initial report is probably too confuse and not clear enough on that aspect), I would like to draw attention on the fact that if indeed there is logic inside pip itself to by-pass the labels for the console scripts at install time there should be a symmetrical one at uninstall time and it doesn't seem to be the case. Or did I somehow miss it? As for the total removal of pip's console scripts (#3164) it would make me very very happy :) |
Likewise! pip records what it installs, and the uninstallation simply removes them. So the install-time console-script bypass does not need to be mirrored there; that definition is not consulted at all for uninstallation. |
I'm afraid I have to insist, since it doesn't match my experience. Hopefully, I didn't misinterpret your words. In the following transcript, notice how the manually added
My assumption is that the file |
You are correct - the relevant code seems to be here. But to be honest, I'm reluctant to add any more complexity to this whole mess. I'd much rather we just removed the console scripts, or at a minimum removed the versioned ones, and bypassed the whole problem. If we can't do that, I think we should just accept the current behaviour is sub-optimal and move on. (I guess we could note somewhere that versioned names pipX.Y are "reserved", and users shouldn't manually create them, but I doubt that's really going to make that much difference). |
Agreed. It's not obvious that it's worth fixing.
Just to be clear, from what I understood of the case that prompted this investigation, such files were not created manually, but were the result of installing and upgrading pip globally for multiple versions of the Python interpreter. As always I'll tell them to use the explicit |
If I understood right the
pipX.Y
console script is set to the version of the Python interpreter used to build the pip's wheel, instead of the version of the Python interpreter used to install it.Found this issue thanks to this question on Stack Overflow:
Looks like the root cause of the issue lies in the
setup.py
for example here in the latest tagged version:pip/setup.py
Lines 75 to 83 in 931749f
Looks to me like the actual
pipX.Y
label is set when the wheel is built. But if it is later installed with a different Python version than the one used to build the wheel, then it is problematic. I would expect that installing from the sdist should not present the issue.I should have a closer look at it with a clean setup, but it seems like surprisingly it is somehow not an issue at install-time (the right
pipX.Y
script is created), but it gets confusing at uninstall-time, in that it seems to delete the wrongpipX.Y
(the one inentry_points.txt
) additionnally to the right one (the one corresponding to the current Python interpreter).Related issues:
The text was updated successfully, but these errors were encountered: