Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to get a django website up and running using WSGI. The box is running centos 5 with python 2.6.

I am attempting to use the anaconda distribution from continuum analytics installed in /usr/local/lib/anaconda/.

I built mod_wsgi with ./configure --with-python=/usr/local/lib/anaconda/bin/python/

I added the following to /etc/httpd/conf/httpd.conf:

<Directory "/var/www/cgi-bin">
   AllowOverride None
   Options None
   Order allow,deny
   Allow from all

WSGIPythonHome /usr/local/lib/anaconda/bin
WSGIScriptAlias /test /var/www/wsgi-scripts/test

<Directory "/var/www/wsgi-scripts">
    Order allow,deny
    Allow from all

but I am getting import failures as follows:

[Fri Mar 08 16:44:24 2013] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 mod_wsgi/3.4    
Python/2.7.3 configured -- resuming normal operations

[Fri Mar 08 16:44:24 2013] [info] Server built: Feb 13 2012 22:31:42
 ImportError: No module named site
 Could not find platform independent libraries <prefix>
 Could not find platform dependent libraries <exec_prefix>

Could anyone point out what my issue is?

share|improve this question
echo $PYTHONPATH? – quanta Mar 9 '13 at 1:37
where would I echo $PYTHONPATH? – Michael WS Mar 9 '13 at 2:30
Run it from the command line. – quanta Mar 9 '13 at 2:34
ok so, I have an apache user and it is undefined for it. What should I do? Should adding it to the path or pythonpath of the user fix it? – Michael WS Mar 9 '13 at 16:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.