title: ImportError: cannot import name tz (psycopg2)
body: <p>I am using Windows XP, and using Python run time from <a href="http://www.python.org/ftp/python/2.7/python-2.7.msi" rel="nofollow">http://www.python.org/ftp/python/2.7/python-2.7.msi</a></p>
  
  <p>If I am running in standalone application, <code>import psycopg2</code> doesn't cause me any trouble. However, when come to mod_wsgi + apache, I will get the following error</p>
  
  <pre><code>[Thu Nov 18 14:26:51 2010] [error] [client 127.0.0.1] mod_wsgi (pid=2832): Target WSGI script 'C:/Projects/SandBox/web/script/index.py' cannot be loaded as Python module.
  [Thu Nov 18 14:26:51 2010] [error] [client 127.0.0.1] mod_wsgi (pid=2832): Exception occurred processing WSGI script 'C:/Projects/SandBox/web/script/index.py'.
  [Thu Nov 18 14:26:51 2010] [error] [client 127.0.0.1] Traceback (most recent call last):
  [Thu Nov 18 14:26:51 2010] [error] [client 127.0.0.1]   File "C:/Projects/SandBox/web/script/index.py", line 9, in &lt;module&gt;
  [Thu Nov 18 14:26:51 2010] [error] [client 127.0.0.1]     import psycopg2
  [Thu Nov 18 14:26:51 2010] [error] [client 127.0.0.1]   File "build\\bdist.win32\\egg\\psycopg2\\__init__.py", line 65, in &lt;module&gt;
  [Thu Nov 18 14:26:51 2010] [error] [client 127.0.0.1]     from psycopg2 import tz
  [Thu Nov 18 14:26:51 2010] [error] [client 127.0.0.1] ImportError: cannot import name tz
  </code></pre>
  
  <p>Here is the python script.</p>
  
  <pre><code>import sys, os
  sys.path.append(os.path.dirname(__file__))
  
  import psycopg2
  
  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>and here is the httpd.conf file.</p>
  
  <pre><code>LoadModule wsgi_module modules/mod_wsgi-win32-ap22py27-3.3.so
  WSGIScriptAlias / "C:/Projects/SandBox/web/"
  &lt;Directory "C:/Projects/SandBox/web"&gt;
      AllowOverride None
      Options None
      Order deny,allow
      Allow from all
  &lt;/Directory&gt;
  </code></pre>
  
  <p>I check the archive <code>C:\Python27\Lib\site-packages\psycopg2-2.2.2-py2.7-win32.egg\</code>, there is  <code>C:\Python27\Lib\site-packages\psycopg2-2.2.2-py2.7-win32.egg\psycopg2\tz.py</code></p>