PYTHON_EGG_CACHE
Sep012009
作者:u2 发布:2009-09-01 10:58 分类:python PYTHON_EGG_CACHE已关闭评论
在使用python写的cgi是遇到如下问题
Can’t extract file(s) to egg cache The following error occurred while trying to extract file(s) to the Python egg cache: [Errno 20] Not a directory: ‘/dev/null/.python-eggs’ The Python egg cache directory is currently set to: /dev/null/.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.
分析其主要原因是启动http服务的用户没有主目录,所以系统默认给分配了/dev/null这个目录,所以当要在/dev/null/中解开egg文件时,会有错误
解决办法为设定PYTHON_EGG_CACHE变量即可,具体如下:
import os
os.environ[‘PYTHON_EGG_CACHE’] = ‘/tmp/’
本文固定链接: https://www.2hei.net/2009/09/01/python_egg_cache/ | 2hei.net
最活跃的读者