title: #!/usr/bin/env python: Getting command not found and Permission Denied
body: <p>I have at the top of the file <code>#!/usr/bin/env python</code>. So it should work when I run the file? But it doesnt. It works when I use <code>python file.py</code> tho</p>
  
  <pre><code>#!/usr/bin/env python
  
  import pygtk
  pygtk.require('2.0')
  import gtk 
  
  class App1:
    def __init__(self):
      self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
      self.window.show()
  
    def main(self):
      gtk.main()
  
  if __name__ == "__main__":
    app = App1()
    app.main()
  </code></pre>
  
  <p>Python Here is what happened: </p>
  
  <pre><code>jiewmeng@jiewmeng:/labs/projects/learnPython$ app1.py
  app1.py: command not found
  jiewmeng@jiewmeng:/labs/projects/learnPython$ ./app1.py
  bash: ./app1.py: Permission denied
  jiewmeng@jiewmeng:/labs/projects/learnPython$ ll
  total 12
  drwxr-xr-x 2 jiewmeng jiewmeng 4096 2011-07-16 22:08 ./
  drwxr-xr-x 4 jiewmeng jiewmeng 4096 2011-07-16 21:45 ../
  -rwxrwxr-x 1 jiewmeng jiewmeng  256 2011-07-16 22:05 app1.py*
  </code></pre>