Reputation: 1095
Hello I'm getting this error on my mac when i tried installing Django using pip. I created a directory and virtual environment. But ran into this error when attempting to install django.
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-8.0.2-py2.7.egg/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-8.0.2-py2.7.egg/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip-8.0.2-py2.7.egg/pip/req/req_set.py", line 731, in install
**kwargs
File "/Library/Python/2.7/site-packages/pip-8.0.2-py2.7.egg/pip/req/req_install.py", line 841, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/Library/Python/2.7/site-packages/pip-8.0.2-py2.7.egg/pip/req/req_install.py", line 1040, in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/pip-8.0.2-py2.7.egg/pip/wheel.py", line 343, in move_wheel_files
clobber(source, lib_dir, True)
File "/Library/Python/2.7/site-packages/pip-8.0.2-py2.7.egg/pip/wheel.py", line 314, in clobber
ensure_dir(destdir)
File "/Library/Python/2.7/site-packages/pip-8.0.2-py2.7.egg/pip/utils/__init__.py", line 82, in ensure_dir
os.makedirs(path)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/django'
Upvotes: 1
Views: 918
Reputation: 2616
Have you activated your virtual environment?
source env/bin/activate
It looks like you are running the default pip and you don't have permission to install into the directory. If you run sudo pip install django
it should work.
Upvotes: 2