Eu sou uma pessoa do Windows e um novato do Ubuntu e DigitalOcean. Eu completei as etapas em
link
e estou passando por
link
mas está falhando em pip install django , com
OSError: [Errno 13] Permission denied: '/opt/myenv/build'
Rastreamento:
(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
Log de depuração:
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
Ignorei o passo do problema e continuei com êxito até pip install gunicorn , altura em que recebi o mesmo erro:
OSError: [Errno 13] Permission denied: '/opt/myenv/build'
FYI: Eu estou fazendo isso dentro de um virtualenv ativado, conforme as instruções.
O que estou fazendo de errado? Obrigado por ajudar.
O acima é o meu principal problema. Se o seguinte é fácil responder além disso, por favor faça. É o passo que preciso dar assim que eu descobrir o seguinte:
Eu também preciso saber como atualizar do Python 2.7.6 para o Python 3.4.1 (ou a versão compatível com o Ubuntu mais alta disponível). O Python já estava instalado - não o instalei.
Eu gostaria de ter apenas 3.4.1. Eu não quero 2.7 e 3.4 lado a lado.
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