Skip to content

Commit 8b521e2

Browse files
committed
Rephrase the warning printed when run as root on Unix
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.
1 parent 5ee933a commit 8b521e2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/pip/_internal/cli/req_command.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,9 @@ def warn_if_run_as_root():
177177
if os.getuid() != 0:
178178
return
179179
logger.warning(
180-
"Running pip as root will break packages and permissions. "
181-
"You should install packages reliably by using venv: "
180+
"Running pip as the 'root' user can result in broken permissions and "
181+
"conflicting behaviour with the system package manager. "
182+
"It is recommended to use a virtual environment instead: "
182183
"https://pip.pypa.io/warnings/venv"
183184
)
184185

0 commit comments

Comments
 (0)