2014-09-07 2 views
9

필자는 Windows 7에 pipet를 설치했으며 pip를 포함하고 설치 중에 python.exe를 PATH에 추가하도록 선택했습니다.pip 설치 요청 예외 및 pip install beautifulsoup4 예외

C:\Python34>pip install beautifulsoup4 
Downloading/unpacking beautifulsoup4 
    Running setup.py (path:C:\Users\User\AppData\Local\Temp\pip_build_User\beautif 
ulsoup4\setup.py) egg_info for package beautifulsoup4 

Installing collected packages: beautifulsoup4 
    Running setup.py install for beautifulsoup4 
    Skipping implicit fixer: buffer 
    Skipping implicit fixer: idioms 
    Skipping implicit fixer: set_literal 
    Skipping implicit fixer: ws_comma 

Successfully installed beautifulsoup4 
Cleaning up... 
    Exception: 
Traceback (most recent call last): 
    File "C:\Python34\lib\shutil.py", line 370, in _rmtree_unsafe 
    os.unlink(fullname) 
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\User\\AppData\\Local 
\\Temp\\pip_build_User\\pip\\pip\\_vendor\\distlib\\w32.exe' 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
    File "C:\Python34\lib\site-packages\pip\basecommand.py", line 122, in main 
    status = self.run(options, args) 
    File "C:\Python34\lib\site-packages\pip\commands\install.py", line 302, in run 

    requirement_set.cleanup_files(bundle=self.bundle) 
    File "C:\Python34\lib\site-packages\pip\req.py", line 1333, in cleanup_files 
    rmtree(dir) 
    File "C:\Python34\lib\site-packages\pip\util.py", line 43, in rmtree 
    onerror=rmtree_errorhandler) 
    File "C:\Python34\lib\shutil.py", line 477, in rmtree 
    return _rmtree_unsafe(path, onerror) 
    File "C:\Python34\lib\shutil.py", line 367, in _rmtree_unsafe 
    _rmtree_unsafe(fullname, onerror) 
    File "C:\Python34\lib\shutil.py", line 367, in _rmtree_unsafe 
    _rmtree_unsafe(fullname, onerror) 
    File "C:\Python34\lib\shutil.py", line 367, in _rmtree_unsafe 
    _rmtree_unsafe(fullname, onerror) 
    File "C:\Python34\lib\shutil.py", line 367, in _rmtree_unsafe 
    _rmtree_unsafe(fullname, onerror) 
    File "C:\Python34\lib\shutil.py", line 372, in _rmtree_unsafe 
    onerror(os.unlink, fullname, sys.exc_info()) 
    File "C:\Python34\lib\site-packages\pip\util.py", line 53, in rmtree_errorhand 
ler 
    (exctype is PermissionError and value.args[3] == 5) #python3.3 
IndexError: tuple index out of range 

    Storing debug log for failure in C:\Users\User\pip\pip.log 

C:\Python34> 

내가 그 예외가 무엇을 의미하는지 궁금 :

C:\Python34>pip install requests 
Requirement already satisfied (use --upgrade to upgrade): requests in c:\python3 
4\lib\site-packages 
Cleaning up... 
    Exception: 
Traceback (most recent call last): 
    File "C:\Python34\lib\shutil.py", line 370, in _rmtree_unsafe 
    os.unlink(fullname) 
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\User\\AppData\\Local 
\\Temp\\pip_build_User\\pip\\pip\\_vendor\\distlib\\w32.exe' 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
    File "C:\Python34\lib\site-packages\pip\basecommand.py", line 122, in main 
    status = self.run(options, args) 
    File "C:\Python34\lib\site-packages\pip\commands\install.py", line 302, in run 

    requirement_set.cleanup_files(bundle=self.bundle) 
    File "C:\Python34\lib\site-packages\pip\req.py", line 1333, in cleanup_files 
    rmtree(dir) 
    File "C:\Python34\lib\site-packages\pip\util.py", line 43, in rmtree 
    onerror=rmtree_errorhandler) 
    File "C:\Python34\lib\shutil.py", line 477, in rmtree 
    return _rmtree_unsafe(path, onerror) 
    File "C:\Python34\lib\shutil.py", line 367, in _rmtree_unsafe 
    _rmtree_unsafe(fullname, onerror) 
    File "C:\Python34\lib\shutil.py", line 367, in _rmtree_unsafe 
    _rmtree_unsafe(fullname, onerror) 
    File "C:\Python34\lib\shutil.py", line 367, in _rmtree_unsafe 
    _rmtree_unsafe(fullname, onerror) 
    File "C:\Python34\lib\shutil.py", line 367, in _rmtree_unsafe 
    _rmtree_unsafe(fullname, onerror) 
    File "C:\Python34\lib\shutil.py", line 372, in _rmtree_unsafe 
    onerror(os.unlink, fullname, sys.exc_info()) 
    File "C:\Python34\lib\site-packages\pip\util.py", line 53, in rmtree_errorhand 
ler 
    (exctype is PermissionError and value.args[3] == 5) #python3.3 
IndexError: tuple index out of range 

    Storing debug log for failure in C:\Users\User\pip\pip.log 

내가 얻을 beautifulsoup4를 설치 PIP 실행하는 경우 :

내가 얻을 요청을 설치 PIP 실행하는 경우?

패키지가 실제로 로그에 주어진대로 성공적으로 설치 되었습니까? 제대로 실행되거나 잘못 되었습니까?

왜 예외가 있으며 어떻게 제거합니까?

+0

beautifulsoup 설치는 PITA입니다. 버전이 무엇이든간에 ...하지만이 특정 상황에서는 문제가되지 않을 수 있습니다. 콘솔이 관리자 권한으로 실행되고 있습니까? – BartoszKP

+0

@BartoszKPc 필자는 개인적으로 Windows에 pip와 함께 bs4를 설치하는 데 문제가 없습니다. – tyteen4a03

+0

예, cmd를 admin으로 실행하지 않는 것이 문제였습니다. 고맙습니다. – lowtechsun

답변

8

모든 예외 예외는 명령 프롬프트에 관리자 권한이 없음을 의미합니다.

관리자 권한으로 명령 프롬프트를 실행합니다 (시작 메뉴에서 cmd를 검색하고 마우스 오른쪽 단추로 클릭하고 관리자 권한으로 실행). 그래도 작동하지 않으면 pip를 다시 설치하십시오. 파일 사용 권한이 어떻게 든 엉망이되었을 수도 있습니다.

+2

cmd를 admin으로 지정하고 두 경우 모두 예외를 지정하지 마십시오. 고맙습니다. – lowtechsun

+2

이 솔루션을 주셔서 감사합니다 ... 권한 문제로 인해 심하게 쑥쑥졌습니다. +1 그 .. – Zax