Environment
Description
Running pip cache
commands with sudo print two messages about cache being disabled, one a Warning and other an Error. (The second error message was introduced recently in https://github.com/pypa/pip/pull/8124)
Expected behavior
Ideally only one message should be printed. Or the second message can be supplanted to distinguish the case between using sudo, or using --no-cache-dir
(We have options.cache_dir = None
in the former, and options.cache_dir = False
in the latter
How to Reproduce
Run sudo pip cache <subcommand>
Output
$ sudo pip cache list
WARNING: The directory '/Users/devesh/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
ERROR: pip cache commands can not function since cache is disabled.
I'm not particularly worried with that, as the output is quite easy to understand. The increased complexity to resolve this is probably not worth it.
... and we don't recommend running pip with sudo anyway 馃檪
Agreed that if the output is good enough to understand currently, we shouldn't make changes to it which need a non-trivial amount of effort.
Should I go ahead and close the issue then?
Should I go ahead and close the issue then?
Yes please.
Most helpful comment
I'm not particularly worried with that, as the output is quite easy to understand. The increased complexity to resolve this is probably not worth it.