2014-09-07 20 views
9

Ho installato Python 3.4.1 su Windows 7, pip incluso e durante l'installazione ho selezionato l'aggiunta di python.exe a PATH.pip installa richieste di eccezioni e pip installa beautifulsoup4 exception

Quando si esegue pip installare le richieste che ricevo:

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 

Quando si esegue pip installare beautifulsoup4 ottengo:

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> 

Mi chiedo che cosa significano queste eccezioni?

I pacchetti sono stati installati correttamente come indicato nel registro e funzioneranno correttamente oppure sto facendo qualcosa di sbagliato.

Perché le eccezioni e come si eliminano?

+0

Installare beautifulsoup è un PITA, qualunque sia la versione ... Ma in questo particolare contesto, questo potrebbe non essere il problema. La console è in esecuzione con privilegi amministrativi? – BartoszKP

+0

@BartoszKPc Personalmente non ho problemi con l'installazione di bs4 con pip su Windows. – tyteen4a03

+0

Sì, non è stato eseguito il cmd come admin. Grazie. – lowtechsun

risposta

8

Tutte le eccezioni di autorizzazione indicano che il prompt dei comandi non ha diritti di amministratore.

Eseguire il prompt dei comandi come amministratore (cercare cmd nel menu di avvio, fare clic con il pulsante destro del mouse, Esegui come amministratore). Se ciò non funziona, prova a reinstallare pip; le autorizzazioni sui file potrebbero essere state rovinate in qualche modo.

+2

Ha eseguito il cmd come amministratore e nessuna eccezione in entrambi i casi. Grazie. – lowtechsun

+2

Grazie per questa soluzione ... È stato gravemente bloccato a causa del problema con le autorizzazioni. +1 per quello .. – Zax

Problemi correlati