# Python\_Interpreter\_Error.

**URL:** <https://forum.ansible.com/t/python-interpreter-error/34756>\
**Category:** Ansible Project\
**Tags:** awx\
**Created:** [March 10, 2021, 6:57am UTC](https://forum.ansible.com/t/python-interpreter-error/34756 "2021-03-10T06:57:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akshay\_Bora](https://avatars.discourse-cdn.com/v4/letter/a/8edcca/32.png) [@Akshay\_Bora](https://forum.ansible.com/u/Akshay_Bora)\
**Post date:** [March 10, 2021, 6:57am UTC](https://forum.ansible.com/t/python-interpreter-error/34756/1 "2021-03-10T06:57:40Z")

</div>

Hi People,

I am running the ansible playbook through AWX and its getting failed with the subjected error. But the same playbook is running on other server successfully. Kindly help to resolve the issue.

{  
“ansible\_facts”: {},  
“msg”: “The following modules failed to execute: setup\n”,  
“failed\_modules”: {  
“setup”: {  
“failed”: true,  
“module\_stdout”: " File "/home/oracle/.ansible/tmp/ansible-tmp-1615285403.4958365-166725-83674126722203/AnsiballZ\_setup.py", line 72\r\n with open(args\_path, ‘rb’) as f:\r\n ^\r\nSyntaxError: invalid syntax\r\n",  
“module\_stderr”: “Shared connection to ###### closed.\r\n”,  
“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,  
“rc”: 1,  
“ansible\_facts”: {  
“discovered\_interpreter\_python”: “/usr/bin/python”  
},  
“warnings”: [  
“Platform linux on host###### is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python interpreter could change this. See [https://docs.ansible.com/ansible/2.9/reference\_appendices/interpreter\_discovery.html](https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html) for more information.”  
]  
}  
},  
“\_ansible\_verbose\_override”: true,  
“\_ansible\_no\_log”: false,  
“changed”: false

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [March 10, 2021, 8:42am UTC](https://forum.ansible.com/t/python-interpreter-error/34756/2 "2021-03-10T08:42:55Z")

</div>

This means it's not an ansible issue, but rather an AWX issue. Please  
use the dedicated AWX list: [https://groups.google.com/g/awx-project](https://groups.google.com/g/awx-project)

---

<div class="post-metadata">

**Author:** ![Akasurde](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akasurde/32/230_2.png) [@Akasurde](https://forum.ansible.com/u/Akasurde)\
**Post date:** [March 10, 2021, 8:54am UTC](https://forum.ansible.com/t/python-interpreter-error/34756/3 "2021-03-10T08:54:49Z")

</div>

it seems that you are using python 2.6 since there is a syntax error for “with” syntax. Try updating the Python version to the latest.

---

<div class="post-metadata">

**Author:** ![Nuno\_Jordao](https://avatars.discourse-cdn.com/v4/letter/n/a4c791/32.png) [@Nuno\_Jordao](https://forum.ansible.com/u/Nuno_Jordao)\
**Post date:** [March 10, 2021, 3:00pm UTC](https://forum.ansible.com/t/python-interpreter-error/34756/4 "2021-03-10T15:00:18Z")

</div>

Aren’t the modules supposed to work with python 2.6? He is running the setup module…  
Probably the behaviour is different because the Ansible versions are different between the Ansible inside AWX and the Ansible in the server.  
That info is lacking from OP. As is the OS version of the managed server…
