Linux Python: 出现directory is not owned by the current user警告

编译源代码的方式安装,在最后执行sudo make install的时候,出现如下警告
The directory '/home/fkjava/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/fkjava/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.


出现这个警告的原因很简单:在用户目录下的~/.cache/pip/http和~/.cache/pip两个目录或者它的上级目录拥有者,不是root用户引起的。因为使用了sudo执行,所以其实这些缓存文件应该在root用户的Home目录里面的。
此时此刻,我们需要在sudo后面加上-H参数即可,就会在执行sudo的时候,把HOME变量的值改为root的Home目录。

最终执行命令为:sudo -H make install

来源:http://www.crazyit.org/forum.php?mod=viewthread&tid=12440

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值