title: Django Apache and Virtualenv ImportError: No module named site
body: <p>The error from apache after a 504 page </p>
  
  <pre><code>[info] mod_wsgi (pid=): Python home /var/venv/mybox.
  [info] mod_wsgi (pid=): Initializing Python.
  ImportError: No module named site
  </code></pre>
  
  <p>This is with a barely configured app. </p>
  
  <pre><code>&lt;IfModule mod_wsgi.c&gt;
  WSGIDaemonProcess myapp python-home=/var/venv/mybox
  WSGIProcessGroup myapp
  WSGIScriptAlias / /var/www/html/web/myapp/wsgi.py
  WSGISocketPrefix /var/run/wsgi
  
  &lt;Directory /var/www/html/web&gt;
  &lt;Files wsgi.py&gt;
  Order deny,allow
  Allow from all
  &lt;/Files&gt;
  &lt;/Directory&gt;
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>Followed every post and tutorial I can. I am on CENTOS6 . using virutal env python 2.7 the default system env is 2.6</p>
  
  <pre><code>$ ldd /etc/httpd/modules/mod_wsgi.so
    linux-vdso.so.1 =&gt;  (0x00007ffc06174000)
  </code></pre>
  
  <p>mywsgi.py</p>
  
  <pre><code> import os,sys     
   from django.core.wsgi import get_wsgi_application     
   os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myapp.settings")
   sys.path.insert(0,'/var/www/html/web')
   activate_this = '/var/venv/mybox/bin/activate_this.py'
   execfile(activate_this, dict(__file__=activate_this))
   application = get_wsgi_application()
  </code></pre>
  
  <p>PYHTONHOME is not set</p>