Skip to content

Repeated message about cache being disabled if pip cache is run with sudo #8142

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

Closed
deveshks opened this issue Apr 26, 2020 · 4 comments
Closed

Comments

@deveshks
Copy link
Contributor

deveshks commented Apr 26, 2020

Environment

  • pip version: pip 20.1.dev1
  • Python version: Python 3.8.2
  • OS: Mac OS 10.15.4

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 #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.
@ghost ghost added the S: needs triage Issues/PRs that need to be triaged label Apr 26, 2020
@sbidoul
Copy link
Member

sbidoul commented Apr 26, 2020

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.

@pfmoore
Copy link
Member

pfmoore commented Apr 26, 2020

... and we don't recommend running pip with sudo anyway 🙂

@deveshks
Copy link
Contributor Author

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?

@sbidoul
Copy link
Member

sbidoul commented Apr 26, 2020

Should I go ahead and close the issue then?

Yes please.

@pradyunsg pradyunsg removed the S: needs triage Issues/PRs that need to be triaged label Feb 12, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants