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
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
  File "/tmp/tmpCmiLCu/pip.zip/pip/req/req_set.py", line 732, in install
  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
  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
  File "/tmp/tmpCmiLCu/pip.zip/pip/utils/__init__.py", line 83, in ensure_dir
  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'
  • Look at the last line. It says ...Permission denied.... This means you need to use sudo – Mostafa Ahangarha Apr 1 '16 at 15:14
  • If some answer worked for you, don't forget to mark it as correct. – Intrus Apr 1 '16 at 15:24

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


run sudo apt-get install python-pip

  • 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 '16 at 15:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.