If you are using a virtualenv
(hint: you should), you can specify the python version when creating the environment:
virtualenv --python=python2.7 <your_venv_name>
For mod_wsgi
, have a look in the apache modules directory. I have no experience with centos, but on Debian, in /usr/lib/apache2/modules
, you can choose the python version by modifying the mod_wsgi.so
symlink (this is on debian oldstable):
lrwxrwxrwx 1 root root 15 Feb 10 2011 mod_wsgi.so -> mod_wsgi.so-2.5
-rw-r--r-- 1 root root 151648 Sep 26 2010 mod_wsgi.so-2.5
-rw-r--r-- 1 root root 151680 Sep 26 2010 mod_wsgi.so-2.6
(For reference: for python3, you need to install a separate package, libapache2-mod-wsgi-py3
)
I imagine centos has something similar. If there isn't, you need to either find a mod_wsgi
package built against python 2.7, or rebuild mod_wsgi
from source against the right python version.