Estoy intentando que WSGI se ejecute con una configuración virtualenv. Tengo la virtualenv todo el funcionamiento correcto:mod_wsgi no está cumpliendo WSGIPythonHome
(virtualenv)dev:/var/www/app$ which python
/var/www/virtualenv/bin/python
(virtualenv)dev:/var/www/app$ python
Python 2.6.1 (r261:67515, Dec 5 2008, 22:09:34)
[GCC 4.1.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import importlib
>>>
Y en mi httpd.conf, tengo el siguiente, tal como se describe here:
WSGIPythonHome /var/www/virtualenv
WSGIPythonPath /var/www/virtualenv/lib/python2.6/site-packages
Pero cuando intento cargar la aplicación a través de Apache, i obtenga el siguiente error:
[Wed Dec 28 12:28:15 2011] [error] [client 127.0.0.1] mod_wsgi (pid=15026): Exception occurred processing WSGI script '/var/www/app/wsgi.py'.
[Wed Dec 28 12:28:15 2011] [error] [client 127.0.0.1] Traceback (most recent call last):
[Wed Dec 28 12:28:15 2011] [error] [client 127.0.0.1] File "/var/www/app/wsgi.py", line 29, in <module>
[Wed Dec 28 12:28:15 2011] [error] [client 127.0.0.1] import importlib
[Wed Dec 28 12:28:15 2011] [error] [client 127.0.0.1] ImportError: No module named importlib
¿Qué me falta? ¿Cómo depurar este tipo de problema?
'importlib' es principalmente una cosa de Python 3 (aunque un * muy * pequeño subconjunto está disponible en 2.7). No está presente en 2.6 en absoluto. – Amber
Muy bien, pero si funciona desde la línea de comandos, ¿no debería funcionar desde Apache? – zigdon