如何在Mac上设置PYTHON_EGG_CACHE环境变量?
我正在尝试设置 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/www
添加到 bashrc
中,但似乎没有任何方法可以解决问题。关于我可能做错了什么有什么建议吗?
注意:www
是我创建的文件夹
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也可以尝试在 wsgi 脚本中设置 Egg 缓存目录,
可以从这里找到
http://code.google.com/p/modwsgi/wiki/ApplicationIssues
Also might try to set the egg cache directory in the wsgi script,
as can be found from here
http://code.google.com/p/modwsgi/wiki/ApplicationIssues
根据您之前的问题,您正在使用 WSGI。您需要
WSGIPythonEggs
或选项rel="nofollow">
WSGIDaemonProcess
。Based on your previous question, you're using WSGI. You want
WSGIPythonEggs
or thepython-eggs
option forWSGIDaemonProcess
.