title: macOs "env: python3: No such file or directory " when executing script with plist
body: <p>I have built a simple web scraper script <code>scraper.py</code> using <code>python 3.6</code> which runs just fine when I executing from the terminal. Now I would like to run it automatically when logging into my computer, so I wrote a simple <code>scraper_launcher.plist</code> file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"    "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
  &lt;plist version="1.0"&gt;
  &lt;dict&gt;
     &lt;key&gt;Label&lt;/key&gt;
     &lt;string&gt;scraper.job&lt;/string&gt;
     &lt;key&gt;ProgramArguments&lt;/key&gt;
     &lt;array&gt;
        &lt;string&gt;./Users/me/Desktop/scraperFolder/scraper.py&lt;/string&gt;
     &lt;/array&gt;
     &lt;key&gt;StandardErrorPath&lt;/key&gt;
     &lt;string&gt;Users/me/Library/Logs/Errors/scraper.error&lt;/string&gt;
     &lt;key&gt;KeepAlive&lt;/key&gt;
     &lt;true/&gt;
  &lt;/dict&gt;
  &lt;/plist&gt;
  </code></pre>
  
  <p>in my <code>Users/me/Library/LaunchAgents/</code> folder.</p>
  
  <p>The first problem I encounter is that when executing <code>launchctl load scraper_launcher.plist</code> macOs seem to use <code>python 2.7</code> by default and the script fails. In order to solve this problem I tried adding at the beginning of <code>scraper.py</code> the shabang specifying the python version: <code>#!/usr/bin/env python3</code>.</p>
  
  <p>Now when I execute <code>./scraper.py</code> on my terminal everything still works fine, but when I do <code>launchctl load scraper_launcher.plist</code> I get the following error: </p>
  
  <p><code>env: python3: No such file or directory</code>.</p>
  
  <p>What am I missing? I have a <code>macOS High Sierra v10.13.6</code>.</p>
  
  <p>PS: Of course I could recode <code>scraper.py</code> into <code>python 2.7</code> but that is not the point, I would like to have it work as it is and understand why scraper_launcher.plist is giving such error.</p>