This is usually caused by trying to make mod_wsgi use a Python virtual environment based off a different Python version that mod_wsgi is compiled for.
In other words, if mod_wsgi was originally compiled for Python 2.5, you cannot force it to work against a Python virtual environment created against Python 2.7. The only choice is to reinstall mod_wsgi with version specifically compiled against the target Python version. So verify what version of Python mod_wsgi is compiled for: http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation#Python_Shared_Library http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation#Python_Installation_In_Use BTW, I would highly discourage putting your virtual environments under /usr/lib. Graham On 7 August 2012 10:52, quantoid <[email protected]> wrote: > error_log: > > [Tue Aug 07 10:39:13 2012] [error] mod_wsgi (pid=28084): Unable to import > 'site' module. > [Tue Aug 07 10:39:13 2012] [error] [client 10.116.49.78] mod_wsgi > (pid=28084): Target WSGI script > '/var/lib/jenkins/jobs/Snoopy/workspace/main/src/snoopy/wsgi.py' cannot be > loaded as Python module. > [Tue Aug 07 10:39:13 2012] [error] [client 10.116.49.78] mod_wsgi > (pid=28084): Exception occurred processing WSGI script > '/var/lib/jenkins/jobs/Snoopy/workspace/main/src/snoopy/wsgi.py'. > [Tue Aug 07 10:39:13 2012] [error] Traceback (most recent call last): > [Tue Aug 07 10:39:13 2012] [error] File > "/var/lib/jenkins/jobs/Snoopy/workspace/main/src/snoopy/wsgi.py", line 16, > in <module> > [Tue Aug 07 10:39:13 2012] [error] import os > [Tue Aug 07 10:39:13 2012] [error] ImportError: No module named os > > httpd.conf: > > # Snoopy Applications > WSGIScriptAlias / > /var/lib/jenkins/jobs/Snoopy/workspace/main/src/snoopy/wsgi.py > WSGIPythonHome /usr/lib/mypy > WSGIPythonPath > /usr/lib/mypy/lib/python2.7:/usr/lib/mypy/lib/python2.7/site-packages:/var/lib/jenkins/jobs/Snoopy/workspace/main/src > > <Directory /var/lib/jenkins/jobs/Snoopy/workspace/main/src/snoopy> > Order deny,allow > Allow from all > </Directory> > > The virtualenv is at /usr/lib/mypy. > > All the files and directories listed in that configuration exist and have > read permission for anyone (chmod a+r). > > I know similar problems have been posted here before but I've read those and > the WSGI manual and still can't get it working. :( > > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/modwsgi/-/MoY_vxuVIskJ. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/modwsgi?hl=en. -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
