I am a Windows person, and an Ubuntu and DigitalOcean newbie. I completed the steps in
https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-12-04
and am going through
but it is failing at pip install django
, with
OSError: [Errno 13] Permission denied: '/opt/myenv/build'
Traceback:
(myenv)jeffy@originaldjangster:~$ 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 1 22, in main
status = self.run(options, args)
File "/opt/myenv/local/lib/python2.7/site-packages/pip/commands/install.py", l ine 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundl e=self.bundle)
File "/opt/myenv/local/lib/python2.7/site-packages/pip/req.py", line 1153, in prepare_files
location = req_to_install.build_location(self.build_dir, not self.is_downloa d)
File "/opt/myenv/local/lib/python2.7/site-packages/pip/req.py", line 218, in b uild_location
_make_build_dir(build_dir)
File "/opt/myenv/local/lib/python2.7/site-packages/pip/req.py", line 1527, 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'
Storing debug log for failure in /home/jeffy/.pip/pip.log
Debug log:
jeffy@originaldjangster:~$ more /home/jeffy/.pip/pip.log
------------------------------------------------------------
/opt/myenv/bin/pip run on Tue Aug 5 14:45:38 2014
Downloading/unpacking django
Cleaning up...
Exception:
Traceback (most recent call last):
File "/opt/myenv/local/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/opt/myenv/local/lib/python2.7/site-packages/pip/commands/install.py", line 278, 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 1153, 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 218, in build_location
_make_build_dir(build_dir)
File "/opt/myenv/local/lib/python2.7/site-packages/pip/req.py", line 1527, 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'
jeffy@originaldjangster:~$
visudo:
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
jeffy ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
I skipped the problem step and proceeded successfully until pip install gunicorn
, at which point I got the same error:
OSError: [Errno 13] Permission denied: '/opt/myenv/build'
FYI: I am doing this within an activated virtualenv, as instructed.
What am I doing wrong? Thank you for helping.
The above is my primary problem. If the following is easy to answer in addition, please do. It is the step I need to take as soon as I figure the above out:
I also need to know how to upgrade from Python 2.7.6 to Python 3.4.1 (or the highest available Ubuntu-compatible release). Python was already installed--I did not install it.
I would like to only have 3.4.1. I don't want 2.7 and 3.4 side by side.
jeffy@originaldjangster:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty
jeffy@originaldjangster:~$ python --version
Python 2.7.6
python2
orpython3
for the latest version of python 3.x on your system, you can also usepython2.7
orpython3.4
to get specific. Im not to hot on virtual env's but you could probably runsudo pip install django
to bypass the permission issue.