2

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
</Directory>

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

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

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?

  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.