Reputation: 304664
Is there an easy way to disable Python egg caching? We have the situation where a system account needs to run a python program which imports a module.
Since this is a non-login robot account, it does not have a home directory, and dies trying to create the directory /.python-eggs
.
What's the best way to fix this? Can I convert my eggs in site-files to something which will not be cached in .python-eggs
?
Upvotes: 1
Views: 781
Reputation: 80091
The best way to fix it is by creating a directory where it can write it's egg cache. You can specify the directory with the PYTHON_EGG_CACHE
variable.
[edit]
And yes, you can convert your apps so they won't need an egg-cache. If you install the python packages with easy_install
you can use easy_install -Z
so it won't zip the eggs and it won't need to extract them. You should be able to unzip the current eggs to make sure you won't need them.
But personally I would just create the egg cache directory.
Upvotes: 3