Centos 5.5 comes with python 2.4 installed, and I needed python 2.7 for a project. I downloaded the source, ran, removed, and tried again with a couple alternative builds:
./configure && make && make install
./configure && make && make altinstall
./configure --prefix=/opt/python2.7 && make && make install
I proceeded to install setuptools and virtualenv (making sure to reference the correct version of python, no symlinks or anything else weird). Built a virtualenv for the project, configured everything correctly for my server, and my final step was building mod_wsgi 3.3 from source for apache 2.2.1, using
./configure --with-apxs=/path/to/apxs --with-python=/path/to/py2.7 && make && make install
All three times, running python, testing out the project locally, etc., worked fine.
BUT after installing mod_wsgi I kept getting silly import errors (cannot import os, sys, site, etc) with my wsgi application.
I ran the short sys.path test script described half-way down the page in the official focs https://code.google.com/p/modwsgi/wiki/InstallationIssues and i get the following output in my logfiles:
sys.path = [ '/correct/path/to/virtualenv/py2.7/lib64/python2.4/', ... ]
Starting with the code.google.com/p/modwsgi recommendations, I tried several different looks to my WSGIPythonHome and WSGIPythonPath ... all variations of
WSGIPythonHome=/path/to/virtualenv/ and ../bin/ and ../bin/python2.7,
WSGIPythonPath=../lib and ../lib/python2.7 and ../lib/python2.7/site-packages.
WSGI and Apache do not appear to be the problems here. Is this an error with how I compiled python2.7, or possibly an error with how my easy_install and virtualenv are configured?