Add an opt-out for the “running as root” warning
See original GitHub issueWhat’s the problem this feature will solve?
I want to be able to manually remove the warning pip spews out during package installation in root environment:
Running pip as the 'root' user can result in broken permissions and conflicting behaviour ..
Describe the solution you’d like
I want to be able to disable this warning through an environment variable like
env PIP_DISABLE_ROOT_WARNING=1 pip install flask
Alternative Solutions
No in tool workaround known to me.
Additional context
We are all adults here, I know what I am doing and I do not want to see a warning every time I run my build system. Let me disable the warning by setting an environment variable. I do not want my users to think there is anything wrong my system just because of the pip tool spews out indiscriminate warning messages.
Code of Conduct
- I agree to follow the PSF Code of Conduct.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:21
- Comments:107 (86 by maintainers)
Top Results From Across the Web
Git for windows 2.35.2 can not add exception safe.directory
When Git is running as ' root ' in a non Windows platform that provides sudo , however, git checks the SUDO_UID environment...
Read more >171 "Not running on a RPi" message from GPIO.setup(id, ...
Resolved it by creating a "gpio" group, and adding an udev rule to give ... When running as root or after changing the...
Read more >Knot Resolver
11.2.3 Running as root. Warning: Executing processes as root is generally insecure, as these processes have unconstrained access to the.
Read more >[Solved]-WARNING: Running pip as the 'root' user-docker
As of pip 22.1 , you can now opt out of the warning using a parameter: pip install ... Composer is running as...
Read more >Enforce HTTPS in ASP.NET Core
For more information, see Opt-out of HTTPS/HSTS on project creation. ... When running as root, sudo and -E are not needed.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Please, can we not have this debate again? Others have already proposed “disable the warning if you’re in a container” and we’ve responded to that (no, the warning is still valid there - I’m quoting others as my personal experience with containers is limited, so don’t bother trying to engage me in debate over this). Repeating arguments that you could have found by searching the tracker for previous discussion on this topic isn’t likely to change anyone’s mind here…
Yeah. Checking if you are in container environment would solve vast majority of problems of people who want this warning removed. I think “running root in container” is equally good reason to skip the warning as “running root in cygwin” or “running on windows”. Happy to make PR if I know there is a consensus for that one.