title: Import modules with mod_wsgi
body: <p>I'm following a simple tutorial on <a href="http://abbett.org/post/setting-up-mod-wsgi-on-wampserver" rel="nofollow">Setting up mod_wsgi on WampServer</a> all runs fine until I try to <strong>Import</strong>, I tried searching the net, but didn't get a working solution, is this a bug issues (maybe not) or certainly a configuration issue? </p>
  
  <p><strong>How to Import a module in mod_wsgi?</strong></p>
  
  <p><em>setup:</em> windows8 64 / wampserver x64 bit / mod_wsgi x64bit</p>
  
  <p><em>Directory:</em> </p>
  
  <ol>
  <li>Wampserver: c:/wamp</li>
  <li>wsgi app  : c:/wamp/www/wsgi</li>
  <li>Python27  : c:/python27</li>
  </ol>
  
  <p>Alias for wsgi app: {created as per in the tutorial via wamp's create an alias option}</p>
  
  <pre><code>WSGIScriptAlias /wsgi/ "c:/wamp/www/wsgi/wsgi.py"
  &lt;Directory "c:/wamp/www/wsgi/"&gt;
      Options Indexes FollowSymLinks MultiViews
      AllowOverride all
          Order allow,deny
      Allow from all
  &lt;/Directory&gt;
  </code></pre>
  
  <p>wsgi.py</p>
  
  <pre><code>from paste import httpserver
  
  try :
      p = sys.argv[1]
      command = "from %(project)s import *" % {"project": p}
      exec(command)
      httpserver.serve(app, host='127.0.0.1', port='8080')
  
  except :
      print "Usage: python runner.py &lt;main_package&gt;"
      sys.exit(0)
  </code></pre>
  
  <p>apache-error-log:</p>
  
  <ul>
  <li>Target WSGI script 'C:/wamp/www/wsgi/wsgi.py' cannot be loaded as
  Python module.</li>
  <li>Exception occurred processing WSGI script 'C:/wamp/www/wsgi/wsgi.py'.</li>
  <li>from paste import httpserver <strong>ImportError: cannot import name
  httpserver</strong></li>
  </ul>
  
  <p>However if I change the above code to:</p>
  
  <pre><code>def application(environ, start_response):
      status = '200 OK'
      output = 'Hello World!'
      response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(output)))]
      start_response(status, response_headers)
      return [output]
  </code></pre>
  
  <p>It prints output.</p>
  
  <p>options tried wsgi.py:</p>
  
  <pre><code>import os, sys
  sys.path.append("c:\\wamp\\www\\wsgi\\paste\\")
  sys.path.append(os.path.dirname(__file__))
  sys.path.append('c:/wamp/www/wsgi/')
  sys.path.insert(0, 'c:/wamp/www/wsgi')
  sys.path.insert(1, 'c:/wamp/www')
  sys.path.insert(0, "c:/wamp/www/wsgi/wsgi.py")
  sys.path.insert(0, "c:/wamp/www/wsgi/paste")
  </code></pre>
  
  <p>Edit: paste module is in apps root directory.</p>