点的-H标志是什么? [英] What is the -H flag for pip?

查看:222
本文介绍了点的-H标志是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

sudo pip install ...与6.0.4或更高版本的pip一起使用时,我会收到一些警告,例如:

When using sudo pip install ... with pip version 6.0.4 or greater, I get some warnings like:

当前用户不拥有目录'/home/drevicko/.cache/pip/log'或其父目录,并且调试日志已被禁用.请检查该目录的权限和所有者.如果使用sudo执行pip,则可能需要-H标志.

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.

此警告似乎已被添加到6.0.4中,但-H标志却没有不会出现在 pip install文档pip的常规选项.

This warning appears to have been 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 ...时需要它?

So, what is the -H flag and why do I need it when using sudo pip install ...?

推荐答案

-H标志实际上用于 sudo 命令,而不用于pip.摘录自文档

The -H flag is actually for the sudo command and not for pip. As taken from the docs

-H(HOME)选项要求安全策略将HOME环境变量设置为密码数据库指定的目标用户(默认为root)的主目录.根据策略,这可能是默认行为.

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.

查看

A look at this question might provide more insight into what could be happening.

这篇关于点的-H标志是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆