LaunchAgents runs Python script in version 2 Maybe someone can explain this. I'm having LaunchAgents run a Python script on startup. The relevant part of the plist looks like:
&lt;key&gt;ProgramArguments&lt;/key&gt;
&lt;array&gt;
    &lt;string&gt;python&lt;/string&gt;
    &lt;string&gt;/Volumes/path to script

This launches the script in python2, despite the fact that &quot;python&quot; points to python3:
/usr/local/bin/python -&gt; /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8

…which errors because launchd is running a python3 script in python2. To fix it I had to specify python3:
&lt;key&gt;ProgramArguments&lt;/key&gt;
&lt;array&gt;
    &lt;string&gt;python3&lt;/string&gt;
    &lt;string&gt;/Volumes/

Am I doing this right? Is python2 coded into launchd somewhere? Is there a reason I still need to specify python3?
As mentioned in the comments, you can use full paths in the XML, e.g.:
&lt;string&gt;/usr/local/bin/python&lt;/string&gt;

launchd isn't aware of environmental variables, like $PATH, unless explicitly set in the XML, so python would default to /usr/bin/python.
https://serverfault.com/questions/111391/use-an-environment-variable-in-a-launchd-script