Report this

What is the reason for this report?

Permission Denied Error with virtualenv installing django

Posted on March 7, 2014

Following the tutorial: How To Install and Configure Django with Postgres, Nginx, and Gunicorn

Step three: Activated the virtualenv then ‘pip install django’ yielded the error below. Virtualenvs are supposed to alleviate permissions issues.

kurt@bangzoom:~$ source /opt/myenv/bin/activate (myenv)kurt@bangzoom:~$ pip install django Downloading/unpacking django Cleaning up… Exception: Traceback (most recent call last): File “/opt/myenv/local/lib/python2.7/site-packages/pip/basecommand.py”, line 134, in main status = self.run(options, args) File “/opt/myenv/local/lib/python2.7/site-packages/pip/commands/install.py”, line 236, in run requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) File “/opt/myenv/local/lib/python2.7/site-packages/pip/req.py”, line 1058, in prepare_files location = req_to_install.build_location(self.build_dir, not self.is_download) File “/opt/myenv/local/lib/python2.7/site-packages/pip/req.py”, line 175, in build_location _make_build_dir(build_dir) File “/opt/myenv/local/lib/python2.7/site-packages/pip/req.py”, line 1390, in _make_build_dir os.makedirs(build_dir) File “/opt/myenv/lib/python2.7/os.py”, line 157, in makedirs mkdir(name, mode) OSError: [Errno 13] Permission denied: ‘/opt/myenv/build’



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Found answer in tutorial’s comments. <br> <br>sudo chown -R youruser:youruser /opt/myenv <br> <br>

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.