如何在Mac上设置PYTHON_EGG_CACHE环境变量?

2024-05-20 20:21:37 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试设置Django以使用MySQL。输入localhost/mysite时出现以下错误

ExtractionError at /
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: '/Library/WebServer/.python-eggs'

The Python egg cache directory is currently set to:

  /Library/WebServer/.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.

从错误消息中我知道我必须更改PYTHON_EGG_CACHE环境变量以指向Apache可以访问的目录。我试着在httpd.conf中添加以下内容

SetEnv PYTHON_EGG_CACHE /var/www
<Directory /var/www>
    Order deny,allow
    Allow from all
</Directory>

而且也只是SetEnv PYTHON_EGG_CACHE /var/wwwbashrc,但似乎没有什么能解决问题。对我可能做错什么有什么建议吗?

注意:www是我创建的文件夹


Tags: thetocacheeggvarwww错误library