I want my Django project to use Python 2.7 instead of 2.6.8. I installed 2.7 and Django 1.5. But my project using the Python 2.6.8 which is default. How can I change it?
Update:
This is my configuration:
<Directory "/var/www/html/a/">
SetHandler python-program
PythonPath "['/var/www/html/'] + sys.path"
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE a.settings
PythonDebug On
</Directory>
It seems that sys.path
gets 2.6.8's paths. This is the Python path that Django sees:
['/usr/lib/python2.7/', '/var/www/html/', '/usr/lib/python2.6/site-packages/pip-1.1-py2.6.egg', '/usr/lib/python2.6/site-packages/django_transmeta-0.6.7-py2.6.egg', '/usr/lib64/python26.zip', '/usr/lib64/python2.6', '/usr/lib64/python2.6/plat-linux2', '/usr/lib64/python2.6/lib-tk', '/usr/lib64/python2.6/lib-old', '/usr/lib64/python2.6/lib-dynload', '/usr/lib64/python2.6/site-packages', '/usr/lib64/python2.6/site-packages/gtk-2.0', '/usr/lib/python2.6/site-packages', '/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info']
pip
command to install all of the packages. Usepip
like thispip install -r requirements.txt
. This is one of the easiest methods. – Radu Gheorghiu