编译源代码的方式安装,在最后执行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
当使用sudo make install编译源代码时,可能会遇到与用户目录下pip缓存相关的权限警告。本文详细解释了这一警告的成因,即由于当前用户并非缓存文件的所有者。解决方案是在sudo命令后添加-H参数,确保缓存文件被创建在root用户的Home目录中。
1690

被折叠的 条评论
为什么被折叠?



