2016-12-25 2 views
-1

ich pip auf meinem Ubuntu-System aktualisieren muß, aber ich bin immer Fehler:pip OSError aktualisieren: [Errno: 13] Zugriff verweigerte

Collecting pip 
    Using cached pip-9.0.1-py2.py3-none-any.whl 
Installing collected packages: pip 
    Found existing installation: pip 8.1.2 
    Uninstalling pip-8.1.2: 
     Successfully uninstalled pip-8.1.2 
    Rolling back uninstall of pip 
Exception: 
Traceback (most recent call last): 
    File "/home/shivams334/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main 
    status = self.run(options, args) 
    File "/home/shivams334/.local/lib/python2.7/site-packages/pip/commands/install.py", line 317, in run 
    prefix=options.prefix_path, 
    File "/home/shivams334/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 742, in install 
**kwargs 
    File "/home/shivams334/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 831, in install 
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix) 
    File "/home/shivams334/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 1032, in move_wheel_files 
    isolated=self.isolated, 
    File "/home/shivams334/.local/lib/python2.7/site-packages/pip/wheel.py", line 346, in move_wheel_files 
    clobber(source, lib_dir, True) 
    File "/home/shivams334/.local/lib/python2.7/site-packages/pip/wheel.py", line 317, in clobber 
    ensure_dir(destdir) 
    File "/home/shivams334/.local/lib/python2.7/site-packages/pip/utils/__init__.py", line 83, in ensure_dir 
    os.makedirs(path) 
    File "/usr/lib/python2.7/os.py", line 157, in makedirs 
    mkdir(name, mode) 
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/pip-9.0.1.dist-info' 
You are using pip version 8.1.2, however version 9.0.1 is available. 
You should consider upgrading via the 'pip install --upgrade pip' command. 

Vielleicht mit ‚chown‘ gehe ich soll, aber nicht wissen, wie um es zu benutzen. Bitte helfen Sie.

+1

Welchen Befehl haben Sie ausgeführt? Hast du Sudo benutzt? – Biffen

+0

@Biffen danke für deine Antwort. Nein, ich habe 'pip install --upgrade pip' verwendet – Shivams334

+0

Er versucht 'pip install -U pip' ... –

Antwort

0

Da Sie Ihre systemweite Python aktualisieren möchten, müssen Sie diesen Befehl mit Administratorrechten auszuführen:

sudo pip install -U pip 

Aber, empfehle ich Ihnen nicht zu ändern/verschmutzen Ihre systemweite Python. Verwenden Sie stattdessen einen virtualenv:

virtualenv myapp 
source myapp/bin/activate 
pip install -U pip # <- only if virtualenv is not up to date 
Verwandte Themen