title: import python module in home directory in CGI script
body: <p>I have a CGI script that needs mechanize, but it is not installed system wide on my web host. I installed it in my home directory</p>
  
  <pre><code>$HOME/.local/lib/python2.7/site-packages/mechanize-0.2.5-py2.7.egg
  </code></pre>
  
  <p>However my CGI script cannot import mechanize</p>
  
  <pre><code>#!/usr/bin/python
  
  import sys,cgi,cgitb
  import mechanize
  ^-- Exception(import mechanize ImportError: cannot import name mechanize)
  </code></pre>
  
  <p>How do I fix this?</p>