Django:PYTHON_EGG_CACHE,访问被拒绝错误

Posted

技术标签:

【中文标题】Django:PYTHON_EGG_CACHE,访问被拒绝错误【英文标题】:Django: PYTHON_EGG_CACHE, access denied error 【发布时间】:2010-12-23 17:40:25 【问题描述】:

我在服务器上部署我的 django 应用程序,在最后阶段我收到此错误:

ExtractionError at /admin/

Can't extract file(s) to egg cache

The following error occurred while trying to extract file(s) to the Python egg
cache:

[Errno 13] Permission denied: '/.python-eggs'

The Python egg cache directory is currently set to:

/.python-eggs

Perhaps your account does not have write access to this directory?  You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.

Request Method:     GET
Request URL:    http://go-ban.org/admin/
Exception Type:     ExtractionError
Exception Value:    

Can't extract file(s) to egg cache

The following error occurred while trying to extract file(s) to the Python egg
cache:

[Errno 13] Permission denied: '/.python-eggs'

The Python egg cache directory is currently set to:

/.python-eggs

Perhaps your account does not have write access to this directory?  You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.

Exception Location:     /usr/lib/python2.5/site-packages/pkg_resources.py in extraction_error, line 887
Python Executable:  /usr/bin/python
Python Version:     2.5.2
Python Path:    ['/home/oleg/sites/goban', '/usr/lib/python2.5/site-packages/PIL-1.1.7-py2.5-linux-i686.egg', '/usr/lib/python2.5/site-packages/PyAMF-0.5.1-py2.5-linux-i686.egg', '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages/PIL', '/var/lib/python-support/python2.5']
Server time:    Sun, 6 Dec 2009 14:05:47 +0200

也许有人遇到过类似的问题?

这里最奇怪的是我在这台主机上使用另一个 django 站点而没有这样的错误:(

相关问题

apache user can not write to .python-eggs

【问题讨论】:

【参考方案1】:

嗯,你正在使用一些奇怪的支持 setuptools 的库。

但是,无论如何,将 PYTHON_EGG_CACHE 环境变量设置为应用程序用户可写的任何目录是否有问题?

【讨论】:

+1:设置这个环境变量并让那个目录归 Apache 用户所有。

以上是关于Django:PYTHON_EGG_CACHE,访问被拒绝错误的主要内容,如果未能解决你的问题,请参考以下文章

使用 zc.buildout 指定自定义 PYTHON_EGG_CACHE 目录?

您如何修复开始出现与 PYTHON_EGG_CACHE 相关的错误的 Trac 安装?

无法使用 XAMPP 从 Python cgi 脚本写入 PYTHON_EGG_CACHE

python导入(MySQLdb)和apache python_egg_cache的问题

Django外网访问

Django rest framework ---节流