RunLoop RunLoop - 4 months ago 129
Python Question

pip install -r: OSError: [Errno 13] Permission denied

I am trying to setup Django.

When I run

pip install -r requirements.txt
, I get the following exception:

Installing collected packages: amqp, anyjson, arrow, beautifulsoup4, billiard, boto, braintree, celery, cffi, cryptography, Django, django-bower, django-braces, django-celery, django-crispy-forms, django-debug-toolbar, django-disqus, django-embed-video, django-filter, django-merchant, django-pagination, django-payments, django-storages, django-vote, django-wysiwyg-redactor, easy-thumbnails, enum34, gnureadline, idna, ipaddress, ipython, kombu, mock, names, ndg-httpsclient, Pillow, pyasn1, pycparser, pycrypto, PyJWT, pyOpenSSL, python-dateutil, pytz, requests, six, sqlparse, stripe, suds-jurko
Cleaning up...
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/", line 122, in main
status =, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/lib/python2.7/dist-packages/pip/", line 1436, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/pip/", line 672, in install
self.move_wheel_files(self.source_dir, root=root)
File "/usr/lib/python2.7/dist-packages/pip/", line 902, in move_wheel_files
File "/usr/lib/python2.7/dist-packages/pip/", line 206, in move_wheel_files
clobber(source, lib_dir, True)
File "/usr/lib/python2.7/dist-packages/pip/", line 193, in clobber
File "/usr/lib/python2.7/", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/amqp-1.4.6.dist-info'

What's wrong and how do I fix this?


Have you tried with sudo?

sudo pip install -r requirements.txt