Skip to content

Commit

Permalink
Rephrase the warning printed when run as root on Unix
Browse files Browse the repository at this point in the history
The earlier warning phrasing has some awkwardness and doesn't clearly
explain why this action is potentially harmful. The change from
"you should" to "it is recommended" is also intentional, to take a
different tone.
  • Loading branch information
pradyunsg committed May 28, 2021
1 parent 5ee933a commit 8b521e2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pip/_internal/cli/req_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,9 @@ def warn_if_run_as_root():
if os.getuid() != 0:
return
logger.warning(
"Running pip as root will break packages and permissions. "
"You should install packages reliably by using venv: "
"Running pip as the 'root' user can result in broken permissions and "
"conflicting behaviour with the system package manager. "
"It is recommended to use a virtual environment instead: "
"https://pip.pypa.io/warnings/venv"
)

Expand Down

0 comments on commit 8b521e2

Please sign in to comment.