title: Python Script: Runs in Shell but fails in real life because cant import module
body: <p>I have a script that runs fine in the Python Shell, but when double clicked it fails to import the PIL module(but it does import the PIL module in the Shell).</p>
  
  <p>What is wrong? Do I need a different shebang? I am on Windows 7:</p>
  
  <pre><code>#!/usr/bin/env python
  """
  
  """
  
  try:
      from   PIL import Image
      import os
      import datetime
      import time
  
  except Exception, e:
      raw_input(str(e))
  
  # Running this script in the Shell, the code gets to here
  # Running this script in real life (just double click it) it prints "no module PIL"
  </code></pre>