views:

35

answers:

2

I'm following the example here: http://code.google.com/p/modwsgi/wiki/IntegrationWithPylons

however, it doesn't work - I get "ImportError: No module named paste.deploy" in the apache error log. Googling in this case helps not - I see some stuff about permissions, but all my permissions are fine. Where does paste.deploy really come from? It comes from PasteDeploy-1.3.4-py2.6.egg in site-packages, installed in my pylonsdevenv directory, right? Well, then how is apache supposed to know about that directory? Does the actual pylons project have to be in the pylonsdevenv directory?

thanks!

+1  A: 

If you can import (from paste.deploy import loadapp) manually it has to be a problem with sys.path. Also make sure that apache uses proper python interpreter. I have something like this in my "passanger_wsgi.py" on Dreamhost:

INTERP = "/home/myuser/bin/python"
if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv)

cwd = os.getcwd()
sys.path.append(os.getcwd())
sys.path.append('/home/myuser/blog')

You can try put some debug and check which paths are inside "sys.path".

Hope this helps.

Maciej Kucharz
A: 

I added:

import site
site.addsitedir('/<yadayada>/pylonsdevenv/lib/python2.6/site-packages')

to the top of my wsgi file, and then set debug = False in my development.ini file (and later, deployment.ini file, I presume), that seemed to work...

Colin