【发布时间】:2018-11-19 09:47:01
【问题描述】:
我想知道这两个命令有什么区别(我感觉它们是相同的):
sudo -H pip install <package>pip --user install <package>
更多信息:
从 sudo 手册页:
-H, --set-home
Request that the security policy set the HOME environment
variable to the home directory specified by the target user's
password database entry. Depending on the policy, this may be
the default behavior.
以及 pip 用户指南:https://pip.pypa.io/en/stable/user_guide/
相关问题:
What is the difference between pip install and sudo pip install?
What is the purpose of "pip install --user ..."? 和
sudo pip install VS pip install --user
但他们都没有谈论sudo -H 选项或两者之间的确切区别。
【问题讨论】:
-
如果用户是root,则相同,“--user”选项仅适用于当前用户
-
这不是重复的。另一个问题与 sudo 无关。