title: How to make python script executable on osx?
body: <p>I just want to make my script as an application. double-click and run instead of running in terminal. I have done it before with automator but now, on el capitan it doesn't work. It only gives error without explanation.</p>
  
  <p>When I try with automator I get this error:</p>
  
  <pre><code>"The action “Run Shell Script” encountered an error."
  </code></pre>
  
  <p>Also I tried the trick below, still I am not able to do this.</p>
  
  <pre><code>#!/usr/bin/env python
  
  chmod +x script.py
  </code></pre>
  
  <blockquote>
    <blockquote>
      <p>SOLVED:</p>
      
      <p>After these two steps. I changed "Open with" to terminal for only this
      file and changed the <code>#!/usr/bin/env python</code> , it works. But it doesn't work without the two steps below, you need to follow all
      steps. </p>
    </blockquote>
    
    <p>Add <code>#!/usr/local/bin/python</code> in the beginning of the code. Then run
    <code>chmod +x myscript.py</code> in terminal. After that change the application
    open with to Terminal.</p>
    
    <p>It worked for me.</p>
  </blockquote>