<p dir="auto">I'm running Archlinx where the default system Python is 3.5. This cases the following code to fail:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ansible -i 127.0.0.1,localhost all -m ping
localhost | FAILED! =&gt; {
    &quot;changed&quot;: false, 
    &quot;failed&quot;: true, 
    &quot;module_stderr&quot;: &quot;&quot;, 
    &quot;module_stdout&quot;: &quot;Traceback (most recent call last):\r\n  File \&quot;/home/miki/.ansible/tmp/ansible-tmp-1454335202.76-249950301753567/ping\&quot;, line 44, in &lt;module&gt;\r\n    import exceptions\r\nImportError: No module named 'exceptions'\r\n&quot;, 
    &quot;msg&quot;: &quot;MODULE FAILURE&quot;, 
    &quot;parsed&quot;: false
}
127.0.0.1 | FAILED! =&gt; {
    &quot;changed&quot;: false, 
    &quot;failed&quot;: true, 
    &quot;module_stderr&quot;: &quot;&quot;, 
    &quot;module_stdout&quot;: &quot;Traceback (most recent call last):\r\n  File \&quot;/home/miki/.ansible/tmp/ansible-tmp-1454335202.76-43713622814893/ping\&quot;, line 44, in &lt;module&gt;\r\n    import exceptions\r\nImportError: No module named 'exceptions'\r\n&quot;, 
    &quot;msg&quot;: &quot;MODULE FAILURE&quot;, 
    &quot;parsed&quot;: false
}"><pre class="notranslate"><code class="notranslate">$ ansible -i 127.0.0.1,localhost all -m ping
localhost | FAILED! =&gt; {
    "changed": false, 
    "failed": true, 
    "module_stderr": "", 
    "module_stdout": "Traceback (most recent call last):\r\n  File \"/home/miki/.ansible/tmp/ansible-tmp-1454335202.76-249950301753567/ping\", line 44, in &lt;module&gt;\r\n    import exceptions\r\nImportError: No module named 'exceptions'\r\n", 
    "msg": "MODULE FAILURE", 
    "parsed": false
}
127.0.0.1 | FAILED! =&gt; {
    "changed": false, 
    "failed": true, 
    "module_stderr": "", 
    "module_stdout": "Traceback (most recent call last):\r\n  File \"/home/miki/.ansible/tmp/ansible-tmp-1454335202.76-43713622814893/ping\", line 44, in &lt;module&gt;\r\n    import exceptions\r\nImportError: No module named 'exceptions'\r\n", 
    "msg": "MODULE FAILURE", 
    "parsed": false
}
</code></pre></div>
<p dir="auto">Changing the #! line in ping.py to <code class="notranslate">#!/usr/bin/python2</code> fixes the problem.</p>
<p dir="auto">This matter is related to ansible's dependancy to python2 and the <a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/e9f0cc1d7db90b45f035e22ed0b1c3c9167674014934fc3ae9365b820575668a/687474703a2f2f646f63732e616e7369626c652e636f6d2f616e7369626c652f6661712e68746d6c23686f772d646f2d692d68616e646c652d707974686f6e2d70617468696e672d6e6f742d686176696e672d612d707974686f6e2d322d782d696e2d7573722d62696e2d707974686f6e2d6f6e2d612d72656d6f74652d6d616368696e65"><img src="https://camo.githubusercontent.com/e9f0cc1d7db90b45f035e22ed0b1c3c9167674014934fc3ae9365b820575668a/687474703a2f2f646f63732e616e7369626c652e636f6d2f616e7369626c652f6661712e68746d6c23686f772d646f2d692d68616e646c652d707974686f6e2d70617468696e672d6e6f742d686176696e672d612d707974686f6e2d322d782d696e2d7573722d62696e2d707974686f6e2d6f6e2d612d72656d6f74652d6d616368696e65" alt="FAQ" data-canonical-src="http://docs.ansible.com/ansible/faq.html#how-do-i-handle-python-pathing-not-having-a-python-2-x-in-usr-bin-python-on-a-remote-machine" style="max-width: 100%;"></a>.</p>
<p dir="auto">How is requiring people to have python point to python2 in /usr/bin/ any better than just requiring python2 in the shebang? Especially, if it's already established that ansible DOES NOT work with python3 which is a preferred candidate for the symlink.</p>
<p dir="auto">Explicitly discouraging users to fix shebangs is even worse (encouraging bad design imho).</p>
<p dir="auto">At some point in the future ansible-scripts will be ported from python2<br>
to python3 - that's also the right time to change the shebang from<br>
python2 to python3 and the dependency for ansible in general.<br>
Then, other maintainers will also have to change their shebangs and port their<br>
modules to python3 in order to support the new version of ansible.</p>