Erro ao instalar o pip para python2.7

1

Eu recebo este erro ao instalar o pip para python2.7:

$python get-pip.py

Collecting pip
  Downloading pip-8.1.1-py2.py3-none-any.whl (1.2MB)
    100% |████████████████████████████████| 1.2MB 294kB/s 
Collecting setuptools
  Downloading setuptools-20.6.7-py2.py3-none-any.whl (508kB)
    100% |████████████████████████████████| 512kB 504kB/s 
Collecting wheel
  Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
    100% |████████████████████████████████| 71kB 403kB/s 
Installing collected packages: pip, setuptools, wheel
Exception:
Traceback (most recent call last):
  File "/tmp/tmpCmiLCu/pip.zip/pip/basecommand.py", line 209, in main
    status = self.run(options, args)
  File "/tmp/tmpCmiLCu/pip.zip/pip/commands/install.py", line 317, in run
    prefix=options.prefix_path,
  File "/tmp/tmpCmiLCu/pip.zip/pip/req/req_set.py", line 732, in install
    **kwargs
  File "/tmp/tmpCmiLCu/pip.zip/pip/req/req_install.py", line 835, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/tmp/tmpCmiLCu/pip.zip/pip/req/req_install.py", line 1030, in move_wheel_files
    isolated=self.isolated,
  File "/tmp/tmpCmiLCu/pip.zip/pip/wheel.py", line 344, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/tmp/tmpCmiLCu/pip.zip/pip/wheel.py", line 315, in clobber
    ensure_dir(destdir)
  File "/tmp/tmpCmiLCu/pip.zip/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'
    
por afeefa 01.04.2016 / 16:56

2 respostas

5

O erro diz permissão negada. Você precisa ter privilégios de root. O comando deve ser sudo python get-pip.py

    
por nidhi 01.04.2016 / 16:59
2

execute sudo apt-get install python-pip

    
por Intrus 01.04.2016 / 17:09