Extractionerror:can ' t extract file (s) to egg cache, [Errno] Permission denied: '/root/.python-eggs '

Source: Internet
Author: User

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
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 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
6 Pythondebug on
7 Pythonpath "['/var/www/sites/django-project '] + sys.path"

Now your Python Eggs have a home, is isn't in root ' s home directory

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.