pip install dj-database-url给出了Permission Denied Error

时间:2013-02-10 05:25:11

标签: django postgresql

执行“pip install dj-database-url”会出现以下错误:

Downloading/unpacking dj-database-url Exception: Traceback (most recent call last):   File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 126, in main
    self.run(options, args)   File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 223, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)   File "/usr/lib/python2.7/dist-packages/pip/req.py", line 942, in prepare_files
    location = req_to_install.build_location(self.build_dir, not self.is_download)   File "/usr/lib/python2.7/dist-packages/pip/req.py", line 144, in build_location
    _make_build_dir(build_dir)   File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1185, in
_make_build_dir
    os.makedirs(build_dir)   File "/usr/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode) OSError: [Errno 13] Permission denied: '/vagrant/django_projects/microblog/build'

Storing complete log in /var/lib/postgresql/.pip/pip.log

我不知道我做错了什么。请帮忙。

2 个答案:

答案 0 :(得分:3)

  1. 设置virtualenv并启动它。

  2. pip install Django psycopg2 south dj-database-url

答案 1 :(得分:1)

使用virtualenv或使用sudo运行您的命令。