pip: inconsistent permissions issues

社会主义新天地 提交于 2019-12-03 10:20:13

When you run a command using sudo, it will preserve the users umask. pip just installs files, it doesn't change access rights, so you'll end up with the files having the access rights set conforming to the current user's umask, which may be owner-readable only (0077) and therefore readable by root only.

That means you can set umask to something sensible like umask 0022 before running sudo pip install. Or use sudo su to open a root shell with default settings and then pip install.

If executing pip with sudo, you may want sudo's -H flag

-H, --set-home set HOME variable to target user's home dir

e.g

sudo -H pip install virtualenv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!