Python:安装egg时的权限问题

2 投票
1 回答
1554 浏览
提问于 2025-04-16 06:44

我尝试用South这个工具在整个网站上安装它,使用的是easy_install。但是我遇到了权限问题:

drwxr-x---   2 root root   4096 Nov  8 10:23 South-0.7.2-py2.6.egg-info

然后我试着用pip来安装,但结果还是一样。

我在想,可能通过改变权限可以解决这个问题。不过,我在安装过程中是不是做错了什么?或者这个包本身有问题吗?

对评论的回答

iddqd: 请把输出结果发过来。用sudo pip install -e hg+http : //bitbucket.org/andrewgodwin/south/来试试。

这是结果:

$ sudo pip-python install -e hg+http://bitbucket.org/andrewgodwin/south/
--editable=hg+http://bitbucket.org/andrewgodwin/south/ is not the right format; it must have #egg=Package

1 个回答

6

可能是你的用户或者根用户(root)设置了一个特定的 umask 值,这个值会导致新创建的文件有某些权限,比如 0027

% umask
027
% sudo touch /tmp/foo
% ls -l /tmp/foo
-rw-r-----  1 root  wheel  0 Nov  8 08:19 /tmp/foo
% umask 002
% touch /tmp/bar
% ls -al /tmp/bar
-rw-r--r--  1 root  wheel  0 Nov  8 08:23 /tmp/bar

撰写回答