This is a dark side effect of using an otherwise beautiful egg mechanism.
Eggs are packages (a directory full of files) packaged in a single .egg file to simplify depolation.
They are stored in the /site-packages/ directory.
As long as the files stored in the egg are .py files, it works great. Import Python can import objects from any file object, like a regular file.
But when something like .so happens, python cannot explain to the underlying OS that it wants to load a library that does not have a physical name. And the only workarounds that, according to the authors, were unpacked into a temporary directory. Naturally, this is not /site-packages/ , since /site-packages/ not available to regular users.
So you can
set PYTHON_EGG_DIR to /tmp or
grant www user write permission /var/www/.python-eggs
(so that files are not unpacked every time you clean / tmp) or better than
unpack the egg as suggested by @ shalley303
(and avoid unzipping the eggs at runtime).
Antony Hatchkins Aug 14 '12 at 18:29 2012-08-14 18:29
source share