使用pip install django_markdown时出错

时间:2014-12-11 16:55:43

标签: python django terminal

我在执行pip install django_markdown时遇到以下错误,有人可以向我解释问题是什么吗?

Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 122, in main
status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
  File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
  File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 671, in install
self.move_wheel_files(self.source_dir, root=root)
  File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 901, in move_wheel_files
pycompile=self.pycompile,
  File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/wheel.py", line 215, in move_wheel_files
clobber(source, lib_dir, True)
  File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/wheel.py", line 205, in clobber
os.makedirs(destdir)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/django_markdown'

Storing debug log for failure in /Users/andrewnguyen/Library/Logs/pip.log

2 个答案:

答案 0 :(得分:0)

Python在回溯的底部报告了一个OSError,说明您对相关文件存在权限问题。

首先尝试以root用户身份运行:

sudo pip install django_markdown

如果这不起作用,那么你可以尝试

sudo chmod +rwx /Library/Python/2.7/site-packages/django_markdown

虽然我怀疑后者如果前者没有解决问题。

答案 1 :(得分:0)

您无权写入' /Library/Python/2.7/site-packages /',您可以使用sudo解决安装包的问题

sudo pip install django_markdown

无论如何,如果您只需要针对特定​​应用程序使用此软件包,这不是最佳做法。

查看virtualenv以正确管理python环境。