-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Warning "There was an error checking the latest version of pip" #12357
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 is due to #12006 and was apparently discussed in the PR. |
I'm assigning this to 23.3 to keep track of it as an issue caused by the release. This does not mean I intent to do a patch release for this at this point. |
Oh, it seems it was also reported in #12338 5 days ago. I had not noticed that one. |
I have this problem too! |
Hi folks. Please don't add "me too" style comments here. If you are affected by this issue, add a 👍🏽 reaction to the first comment. |
Another case this error happens but isn't described here is when you downgrade from 23.3 to 23.2.1. Which I had to do today to test an issue I am facing today to see if it's the Pip upgrade or something else, and reading the PR it does look like I predicted this would be an issue. |
Also, just a pedantic suggestion... If it is a warning, do not put "error" in the message. |
As a workaround, setting a |
I would recommend in CI/CD pipelines anyway, the chance of this failing is non-zero and not useful when it does. I think, although haven't checked specifically, the issue when you downgrade is the new datetime format is trying to be parsed by the old parsing logic. I believe running |
This should now be fixed on |
Thanks, this worked for now as a workaround at least to unblock pipelines. |
Another workaround is to delete the pip cache - on Linux this is in |
Any idea when we can expect a release with this code in it? |
As there are several easy workarounds I'm not rushing a patch release. I plan to do one after the fix for #12361 has landed. |
The solution by owainkenwayucl also works inside a venv. |
You can use |
However, Here are the results of running
|
FWIW, the targeted cleanup step here is to delete the selfcheck directory within the cache.
|
Why does this work? |
The underlying issue is that a key-value pair in a JSON object, placed in a JSON file in that directory contains a value that can't be parsed by this version of pip, when it has been generated by a sufficiently old version of pip. Deleting the directory removes specifically the problematic files, which resolves this issue. |
I think I can guess the reason. The state file in the selfcheck directory must have contained an "invalid" ISO date and time format that included a trailing Z time zone. I no longer have a copy of the original selfcheck state file, but the "new" state file (after removing the pip cache) contains an ISO date and time format that has a trailing "+00:00" time zone that Python 3.10 can interpret:
If I replace "+00:00" in this file with "Z", pip again reports the version check warning (error):
|
pip 23.3.1 has been released with the fix for this. |
Description
Pip issues the warning message "WARNING: There was an error checking the latest version of pip" when running "pip list -o" on Python 3.10 running inside Windows 11.
If I run "pip list -o -vv", the following stack trace is generated:
Might this be the underlying cause?
https://www.reddit.com/r/Python/comments/163ugsm/psa_as_of_python_311_datetimefromisoformat/
Expected behavior
No warning message appears
pip version
23.3
Python version
3.10
OS
Windows 11
How to Reproduce
Output
Code of Conduct
The text was updated successfully, but these errors were encountered: