ExtractionError: Can’t extract file(s) to egg cache, [Errno 13] Permission denied: ‘/root/.python-eggs’
来源:互联网 发布:网站商城源码 编辑:程序博客网 时间:2024/04/28 11:00
ExtractionError: Can’t extract file(s) to egg cache, [Errno 13] Permission denied: ‘/root/.python-eggs’
Posted by alex in Errors at 2:07 PMI received an error when configuring a Django run site for the first time. The setup included installing and configuring some items I am not so familiar with such as mod_python, Django, and other Python items. I finally started making some progress and when I initially launched a test site I received the below errors in the debug output.
Short Error: ExtractionError: Can’t extract file(s) to egg cache
That was the portion at the very top of the error followed by the below output which pointed in the right direction for an easy fix which is noted below.
Apache mod_python Long Error Regarding Python Eggs:
01
ExtractionError: Can't extract
file
(s) to egg cache
02
03
The following error occurred
while
trying to extract
file
(s) to the Python egg
04
cache:
05
06
[Errno 13] Permission denied:
'/root/.python-eggs'
07
08
The Python egg cache directory is currently
set
to:
09
10
/root/.python-eggs
11
12
Perhaps your account does not have write access to this directory? You can
13
change the cache directory by setting the PYTHON_EGG_CACHE environment
14
variable to point to an accessible directory.
So what this appeared to be telling me was that the mod_python configuration I had just configured was attempting to write some sort of output to root’s home directory from the apache user. I had seen suggested that you might just touch the file .python_eggs in root’s home directory however this would not be the proper method to resolve this issue for security reasons. Since the /tmp directory allows any user to write to it already its a safe bet to put .python_eggs there. If anyone that reads this has a better location it still seems like /tmp/.python_eggs is not the best place for that file but I was unable to verify there was an issue storing it there and many others suggest that is a good place.
Verify Apache mod_env Installed:
Make sure that the mod_env Apache module is installed. You can do so by looking at your httpd.conf file and making sure it has configuration lines similar to the below.
1
httpd.conf:LoadModule env_module modules/mod_env.so
2
httpd.conf:LoadModule setenvif_module modules/mod_setenvif.so
Modify Django Project Apache Configuration:
The following line needs to be added to the site configuration for the project using Apache’s mod_python. This may be able to be set on a global level but I did not test that and instead used it directly in the section that specifically uses it.
Apache Directory Configuration Line For Pythin Eggs Output:
1
SetEnv PYTHON_EGG_CACHE /tmp
So now my complete Django Apache project configuration looked similar to the below.
Django Project Apache Configuration With PYTHON_EGG_CACHE Environment Variable Set:
1
SetHandler python-program
2
PythonHandler django.core.handlers.modpython
3
SetEnv DJANGO_SETTINGS_MODULE settings
4
SetEnv PYTHON_EGG_CACHE /tmp
5
PythonOption django.root /some-directory
6
PythonDebug On
7
PythonPath
"['/var/www/sites/django-project'] + sys.path"
Now your Python Eggs have a home that is not in root’s home directory
- ExtractionError: Can’t extract file(s) to egg cache, [Errno 13] Permission denied: ‘/root/.python-eggs’
- pkg_resources.ExtractionError: Can't extract file(s) to egg cache 解决办法
- 装完 mysql-python 报错 [Errno 13] Permission denied: '/root/.python-eggs'
- nginx+uwsgi+django报错:[Errno 13] Permission denied: ‘/root/.python-eggs’
- nginx+uwsgi+django报错:[Errno 13] Permission denied: ‘/root/.python-eggs’
- Can't find file: './performance_schema/cond_instances.frm' (errno: 13 - Permission denied)
- Permission denied: ... .python-eggs
- man: can't change directory to '/root': Permission denied
- OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pip-1.5-py2.7.egg/EGG-INFO
- svn: Can't open file 'PATH/TO/YOUR/FILES/.svn/lock': Permission denied
- 解决 “python [Errno 13] Permission denied”
- 解决 “python [Errno 13] Permission denied”
- 553 Can't open that file: Permission denied
- can't open file db/txn-current-lock:permission denied
- svn: Can't open file 'PATH/TO/YOUR/FILES/.svn/lock': Permission denied - See more at: http://ericlon
- mysql: Can’t start server: can’t create PID file:Permission denied 错误解决
- [Errno 13] Permission denied处理
- IOError: [Errno 13] Permission denied
- 修改 ModPython 下 PYTHON_EGG_CACHE 报错
- 在Qt中保持GUI响应[上]
- Ubuntu下三大CHM阅读软件
- 计算机类图书之旅
- Linux内核同步介绍和方法
- ExtractionError: Can’t extract file(s) to egg cache, [Errno 13] Permission denied: ‘/root/.python-eggs’
- 【转】几个关于日期的小函数
- 小波之旅
- 即将发布个人网站大家呱唧呱唧
- 《自动绘制桩及地质填充》程序下载
- 拯救ASP---Quickwork For Asp MVC 开发框架-留言本实例及下载
- bind2nd
- Windows7复制用户的实现方法
- 【转】计算日期的shell程序