[CentralOH] How do .eggs work in search paths?

Neil Ludban nludban at columbus.rr.com
Wed Dec 5 13:10:15 CET 2012


See if this works:

import site
site.addsitedir('/srv/website/www/site-packages')


http://docs.python.org/2/library/site.html


On Tue, 4 Dec 2012 22:08:24 -0500
Joshua Kramer <joskra42.list at gmail.com> wrote:
> Hello,
> 
> I have a basic question.  I am trying to put Mezzanine under Apache using
> wsgi.  In order to not clutter up the system site-packages directory, I
> have a directory like so:
> 
> /srv/website/www/site-packages
> 
> Under this site-packages are a number of packages provided by Mezzanine:
> 
> bleach-1.1.5-py2.6.egg
> filebrowser_safe-0.2.12-py2.6.egg
> Mezzanine-1.2.4-py2.6.egg
> pytz-2012h-py2.6.egg
> Django-1.4.2-py2.6.egg
> grappelli_safe-0.2.10-py2.6.egg
> Pillow-1.7.8-py2.6-linux-x86_64.egg
> setuptools-0.6c11-py2.6.egg
> easy-install.pth
> html5lib-0.95-py2.6.egg
> pip-1.1-py2.6.egg
> setuptools.pth
> 
> The eggs are really directories themselves, and under each .egg lies the
> module.  So for example, under Mezzanine-1.2.4-py2.6.egg, there's a
> 'mezzanine' directory.
> 
> In the wsgi launcher, I have a call like this:
> 
> sys.path.append('/srv/website/www/site-packages')
> 
> This appears to not be working, as Apache can't find any of the modules
> under that site-packages directory that are within the eggs.
> 
> Is there a cleaner or more elegant way to get to where I want to be?
> 
> Thanks!
> -JK


More information about the CentralOH mailing list