执行“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
我不知道我做错了什么。请帮忙。
答案 0 :(得分:3)
设置virtualenv并启动它。
pip install Django psycopg2 south dj-database-url
答案 1 :(得分:1)
使用virtualenv
或使用sudo
运行您的命令。