question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add an opt-out for the “running as root” warning

See original GitHub issue

What’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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:21
  • Comments:107 (86 by maintainers)

github_iconTop GitHub Comments

9reactions
pfmoorecommented, Oct 8, 2021

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…

9reactions
potiukcommented, Oct 8, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found