서문으로, 저는 현재 OSX 10.9.1에서 Python 2.7을 사용하고 있습니다.easy_install 및 파일 권한
easy_install
(이 예에서는 pip
)을 사용하여 Python 패키지를 설치하고 싶습니다.
easy_install pip
을 그리고 나는 내가 site-packages
디렉토리에 쓰기 권한이없는 것을 말한다 오류가 발생합니다 : 우선 시도. 문제 없습니다 :
sudo easy_install pip
모든 것이 잘 다운로드되지 않습니다. 다음은 pip
를 설치 한 후 내가 가지고있는 배쉬 세션을 보여줍니다
$ pip
-bash: /usr/local/bin/pip: Permission denied
$ cd /usr/local/bin/pip
$ ls -l
...
-rwx------ 1 root admin 275 Jan 10 11:05 pip
...
$ chmod 754 pip
chmod: Unable to change file mode on pip: Operation not permitted
$ sudo chmod 754 pip
$ pip
Traceback (most recent call last):
File "./pip", line 5, in <module>
from pkg_resources import load_entry_point
File "build/bdist.macosx-10.8-intel/egg/pkg_resources.py", line 3007, in <module>
File "build/bdist.macosx-10.8-intel/egg/pkg_resources.py", line 728, in require
requirements specified when this environment was created, or False
File "build/bdist.macosx-10.8-intel/egg/pkg_resources.py", line 626, in resolve
pkg_resources.DistributionNotFound: pip==1.5
좋아, 그래서 어쩌면 권한 중 일부는 여전히 엉망이된다. 여기에 내가 /Library/Python/2.7/site-packages/
볼 때 찾기가 나를 보여주고있는 작업은 다음과 같습니다
을 그리고 여기 ls -l
반환이 같은 디렉토리를 볼 때 무엇을 :
...
drwx------ 4 root wheel 136 Jan 10 11:24 pip-1.5-py2.7.egg
...
이 좋아, 그래서 나는 분명히 pip
를 사용할 수있는 권한이 없습니다 아카이브 파일에 대한 실행 권한이 없기 때문에 여전히 그렇습니다. 방법에 대해 : 내 가정은 내가 sudo
을 사용하기 때문에 모든 권한이 엉망이되어 지금은 단지 권한을 주위에 쫓고있어 것입니다
$ chmod 754 pip-1.5-py2.7.egg
chmod: Unable to change file mode on pip-1.5-py2.7.egg/: Operation not permitted
$ sudo chmod 754 pip-1.5-py2.7.egg
$ pip
Traceback (most recent call last):
File "/usr/local/bin/pip", line 9, in <module>
load_entry_point('pip==1.5', 'console_scripts', 'pip')()
File "build/bdist.macosx-10.8-intel/egg/pkg_resources.py", line 378, in load_entry_point
def get_resource_stream(manager, resource_name):
File "build/bdist.macosx-10.8-intel/egg/pkg_resources.py", line 2565, in load_entry_point
section = line[1:-1].strip()
ImportError: Entry point ('console_scripts', 'pip') not found
. 하지만 이것은 잘못된 것일 수 있습니다. OSX 10.9로 업그레이드하기 전에이 문제가 발생하는 것을 결코 기억하지 못합니다.
내 질문은 : 내가 컴퓨터 관리자이더라도으로 유닉스 시스템이 항상 이것을합니까? 이 패키지를 영구적으로 수정하여 실제로 설치된 패키지를 실행할 수있는 권한이있는 방법이 있습니까? 내 시스템 어딘가에 잘못된 설정이 있다고 생각합니까?
이유 번호 273을 비공개로 업그레이드하지 마십시오 ... – MattDMo
@Thanizer,'디스크 유틸리티 '를 실행하고 사용 권한을 복구 했습니까? 그것은 시작할 수있는 좋은 장소 일 것입니다. 또한 chmod 754는 그것을 자르지 않을 것이고, 당신은 755를 사용하고 그것을위한'owner root','group wheel'을 가질 필요가 있습니다. –
@ I'L'I, 방금 사용 권한을 수정했습니다. 지금은 Homebrew 용 파이썬 공식을 사용하고 있으며 모든 것이 잘 작동하는 것 같습니다. 내가 왜 OSX의 네이티브'easy_install' 스크립트를 사용할 수 없는지 여전히 알고 싶지만 권한 문제는 없습니다. – Thanizer