Description
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
- Set
PIP_CACHE_DIR
to a non-existing path (for exampleD:\PACKAGES\pip
if you don't have aD:
drive) - Run
python -m pip install pip -U
from command prompt
Note that the versions listed are probably not the only ones affected but are the ones I tested with.
Output
C:\Install>python --version
Python 3.12.10
C:\Install>ver
Microsoft Windows [Version 10.0.19044.5737]
C:\Install>python -m pip install pip -U
Requirement already satisfied: pip in c:\programs\python\lib\site-packages (25.1)
WARNING: There was an error checking the latest version of pip.
Here's also full debug output: debug.txt
From it we can see what the actual error is:
PermissionError: [WinError 5] Access is denied: 'd:\\packages'
In this case drive D:
does not exist at all, so even the Windows error code seems misleading.
Code of Conduct
- I agree to follow the PSF Code of Conduct.