ExtractionError: Can't extract file(s) to egg cache The following error occurred while trying to extract file(s) to the
(from: http://docs.tur
Setting the Egg Cache Directory
If you try to start apache right now you will receive an error like this one:
ExtractionError: 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: '/var/www/.python-eggs'
The Python egg cache directory is currently set to:
/var/www/.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.
The problem comes from the fact thatmod_python needs to unzip the required eggs before your application canuse them, but for this the user under which apache runs needs to havewrite access to the specified directory.
There are diverse solutions to solve this problem.
1. The first would be to give write access to the apache user to this /var/www/.pytho
2. The second way is to install all eggs unzipped to avoid the need to have a directory writable by apache.
3. The third way is to specify before running apache were the apache user should unzip the eggs.
We won't talk about the first solution because it is NOT an option in a production environment.
The second option to install all TurboGears dependency by specifying that you want them unzipped can be realised doing so:
easy_install -UZ kid
tomake sure that kid is installed unzipped intead of inside a zipped egg.Then repeat the operation for each egg that you see in the<Python_Root>/s
The third option is a bit different since you will set an environment variable to be picked up by apache:
mkdir -p /tmp/turbogears
export PYTHON_EGG_CACH
apachectl start
it is your responsibility to correctly secure this /tmp/turbogears
I have seen informations about using a PythonOption to set the PYTHON_EGG_CACH