如何在Mac上设置PYTHON_EGG_CACHE环境变量? [英] How to setup up PYTHON_EGG_CACHE environment variable on Mac?
问题描述
localhost / mysite
时,我收到以下错误/
中的ExtractionError无法将文件提取到egg cache
尝试将文件解压缩到Python egg
缓存时出现以下错误:
[Errno 13]权限被拒绝:'/Library/WebServer/.python-eggs'
Python egg缓存目录目前设置为:
/Library/WebServer/.python-eggs
也许您的帐户没有这个目录的写入权限?您可以
通过将PYTHON_EGG_CACHE环境
变量设置为指向可访问的目录来更改缓存目录。
从错误消息中我知道我必须更改 PYTHON_EGG_CACHE
环境变量指向Apache可以访问的目录。我尝试将以下内容添加到
httpd.conf
SetEnv PYTHON_EGG_CACHE / var / www
< Directory / var / www>
订单拒绝,允许
允许从所有
< / Directory>
还只是 SetEnv PYTHON_EGG_CACHE / var / www
到 bashrc
,但似乎没有解决问题。关于我可能做的错误的任何建议?
注意: www
是我创建的文件夹
也可能尝试在wsgi脚本中设置egg缓存目录,
import os
pre>
os.environ ['PYTHON_EGG_CACHE'] ='/ usr / local / pylons / python-eggs'
从这里可以找到
http://code.google.com/p/modwsgi/wiki/ApplicationIssuesI am trying to setup Django to use MySQL. I am getting the following error when I type in
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.
From the error message I know that I have to change the
PYTHON_EGG_CACHE
environment variable to point to a directory that Apache can access. I tried adding the following tohttpd.conf
SetEnv PYTHON_EGG_CACHE /var/www <Directory /var/www> Order deny,allow Allow from all </Directory>
and also just
SetEnv PYTHON_EGG_CACHE /var/www
tobashrc
, but nothing seems to resolve the problem. Any suggestions on what I might be doing wrong?Note:
www
is a folder that I created解决方案Also might try to set the egg cache directory in the wsgi script,
import os os.environ['PYTHON_EGG_CACHE'] = '/usr/local/pylons/python-eggs'
as can be found from here http://code.google.com/p/modwsgi/wiki/ApplicationIssues
这篇关于如何在Mac上设置PYTHON_EGG_CACHE环境变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!