1

I get this error while installing pip for 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'
2
  • Look at the last line. It says ...Permission denied.... This means you need to use sudo Apr 1, 2016 at 15:14
  • If some answer worked for you, don't forget to mark it as correct.
    – Intrus
    Apr 1, 2016 at 15:24

2 Answers 2

5

The error says permission denied. You need to have root privileges. The command should be sudo python get-pip.py

2

run sudo apt-get install python-pip

1
  • 1
    This is likely the more safe method; use the python-pip that came with your system, so you make sure you get the right version of pip for the python version on your computer
    – Thomas Ward
    Apr 1, 2016 at 15:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .