Extractionerror:can ' t extract file (s) to egg cache, [Errno] Permission denied: '/root/.python-eggs ' Posted by Alex-Errors at 2:07 PM 1
I received an error while configuring a Django run site for the "the". The setup included installing and configuring some items I am not so familiar with such as Mod_python, Django, and other P Ython items. I finally started making some progress and 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 is the portion at the "very top of" the error followed by the below output which pointed into the right direction Easy fix which is noted below.
Apache Mod_python Long Error regarding python Eggs:
01 |
Extractionerror:can ' t extract file (s) to egg cache |
03 |
The following error occurred while trying to extract file (s) to the Python egg |
06 |
[Errno 13] Permission denied: '/root/.python-eggs ' |
08 |
The Python Egg cache directory is currently set to: |
12 |
Perhaps your account does don't have write access to this directory? You can |
13 |
Change the cache directory by setting the Python_egg_cache environment |
14 |
Variable to a accessible directory. |
So what this appeared to be telling me is that the Mod_python configuration I had just configured is attempting to write Some sort of output to Root's home directory from the Apache user. I had seen suggested that for you might just touch the file. Python_eggs in Root's home directory however this would does be th E Proper to resolve this issue for the 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 the ' not ' But I was unable to verify there was a issue storing it there and many others suggest this is a good place.
Verify Apache mod_env installed:
Make sure this mod_env Apache module is installed. You can do with looking at your httpd.conf file and making sure it has configuration lines similar.
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 is added to the site configuration for the project using Apache ' s mod_python. This May is able to is set on a global level but I did not test and instead used it directly in the "section" spec Ifically uses it.
Apache Directory Configuration line for Pythin Eggs Output:
1 |
Setenv python_egg_cache/tmp |
So now I 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 |
7 |
Pythonpath "['/var/www/sites/django-project '] + sys.path" |
Now your Python Eggs have a home, is isn't in root ' s home directory