pip 的 -H 标志是什么?
What is the -H flag for pip?
在 pip 版本 6.0.4 或更高版本中使用 sudo pip install ...
时,我收到一些警告,例如:
The directory '/home/drevicko/.cache/pip/log' or its parent directory is not owned by the current user and the debug log has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want the -H flag.
此警告似乎已 added in 6.0.4, but the -H
flag doesn't appear in the pip install
docs nor in the docs on pip's general options。
那么,什么是 -H
标志,为什么我在使用 sudo pip install ...
时需要它?
-H 标志实际上用于 sudo 命令而不是 pip。摘自 docs
The -H (HOME) option requests that the security policy set the HOME environment variable to the home directory of the target user (root by default) as specified by the password database. Depending on the policy, this may be the default behavior.
查看 this 问题可能会更深入地了解可能发生的情况。
在 pip 版本 6.0.4 或更高版本中使用 sudo pip install ...
时,我收到一些警告,例如:
The directory '/home/drevicko/.cache/pip/log' or its parent directory is not owned by the current user and the debug log has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want the -H flag.
此警告似乎已 added in 6.0.4, but the -H
flag doesn't appear in the pip install
docs nor in the docs on pip's general options。
那么,什么是 -H
标志,为什么我在使用 sudo pip install ...
时需要它?
-H 标志实际上用于 sudo 命令而不是 pip。摘自 docs
The -H (HOME) option requests that the security policy set the HOME environment variable to the home directory of the target user (root by default) as specified by the password database. Depending on the policy, this may be the default behavior.
查看 this 问题可能会更深入地了解可能发生的情况。