-
Notifications
You must be signed in to change notification settings - Fork 3.1k
There was an error checking the latest version of pip #13352
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
Comments
This looks like pip is expecting its cache directory to be in a different place than the default. Did you at any stage move your Python installation from one drive to another? Or do you have a configuration file that overrides the default cache directory? What does |
Additionally, the logs of a run with |
Pss. Both of your questions have already been answered in the original post.
I'd say that improving the error message when pip fails to check whether there is a newer version of pip available is a reasonable request. It's also rather low priority since it's just a warning and unlikely to cause problems. I suppose we could augment the error message with a simple "reason"
Or to be even more broad.
The bikeshedding can occur in the PR that improves the situation here, though. I am NOT married to my suggestions, at all. |
@ichard26 Thank you for considering it. As a user (and a developer), I do have a slightly different view on how this should be fixed. Ideally, the check whether package cache directory is accessible should be done before doing anything else, and user should be forced to remedy the situation by setting a valid The error message text also needs improvement. The whole concept of saying "WARNING: There was an error doing x" mixes different problem severities in the same sentence. If there was an error then severity should be ERROR, not a WARNING. Different wording can help resolve this ambiguity. Your suggestion:
Still doesn't seem to tell the truth — If I am not mistaken I understand that you might not want to change the behavior from warning to error when cache dir is inaccesible because of scripting that might break. The decision whether to potentially break scripting by converting this warning into an error boils down to answering the question whether denying access to pip cache dir can help faciliate supply chain attacks. I am not an expert on the subject, but I think the risk is there so if by any chance you decide to do so, then the error message could be:
Otherwise, if you stick with a warning:
Of course, warning should be suppressed if Whatever you decide to do, I'd suggest "failed to do x" over "there was an error doing x" — active .vs. passive voice is much clearer and shorter. |
Good suggestions - why don't you propose a PR and lead it to completion @levicki -> that would be nice contribution back |
I woouldn't want to waste time making a PR that could potentially cause breakage by behavior change without maintainers chiming in first. I'd like to hear what they think about the potential security angle of this issue first. That said, I wouldn't mind even though I am not familiar with the codebase or build system and I could probably only test the Windows part at the moment. |
Description
This is not a duplicate of previous identically named issues.
This still happens on Windows when package cache path set in the environment variable
PIP_CACHE_DIR
is not accessible for any reason.Expected behavior
When running
python -m pip install pip -U
it is expected that it completes without errors. If it encounters errors those errors should be conveyed to the user in a meaningful way without the need to scour debug logs.In this particular case, I would expect from the package manager to validate the package cache path set in the environment variable before trying to do anything else and if that path is inaccesible for whatever reason it should say so instead of giving a cryptic warning whose wording implies some sort of transient network error.
pip version
25.1
Python version
Python 3.12.10
OS
Windows 10/11
How to Reproduce
PIP_CACHE_DIR
to a non-existing path (for exampleD:\PACKAGES\pip
if you don't have aD:
drive)python -m pip install pip -U
from command promptNote that the versions listed are probably not the only ones affected but are the ones I tested with.
Output
Here's also full debug output: debug.txt
From it we can see what the actual error is:
In this case drive
D:
does not exist at all, so even the Windows error code seems misleading.Code of Conduct
The text was updated successfully, but these errors were encountered: