# The following modules failed to execute: setup

**URL:** <https://forum.ansible.com/t/the-following-modules-failed-to-execute-setup/33437>\
**Category:** Ansible Project\
**Created:** [July 20, 2020, 3:59pm UTC](https://forum.ansible.com/t/the-following-modules-failed-to-execute-setup/33437 "2020-07-20T15:59:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nagesh\_sheregar](https://avatars.discourse-cdn.com/v4/letter/n/3ec8ea/32.png) [@Nagesh\_sheregar](https://forum.ansible.com/u/Nagesh_sheregar)\
**Post date:** [July 20, 2020, 3:59pm UTC](https://forum.ansible.com/t/the-following-modules-failed-to-execute-setup/33437/1 "2020-07-20T15:59:05Z")

</div>

Hi Team,

did anyone face this issue, it was working fine but today i am getting below error not sure what happened:

fatal: [localhost]: FAILED! =\> {  
“ansible\_facts”: {},  
“changed”: false,  
“failed\_modules”: {  
“setup”: {  
“exception”: “Traceback (most recent call last):\n File "/root/.ansible/tmp/ansible-tmp-1595260298.32-3449-114062721166446/AnsiballZ\_setup.py", line 102, in \n \_ansiballz\_main()\n File "/root/.ansible/tmp/ansible-tmp-1595260298.32-3449-114062721166446/AnsiballZ\_setup.py", line 20, in \_ansiballz\_main\n import tempfile\n File "/opt/rh/python27/root/usr/lib64/python2.7/tempfile.py", line 32, in \n import io as \_io\n File "/opt/rh/python27/root/usr/lib64/python2.7/io.py", line 51, in \n import \_io\nImportError: /opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/\_io.so: undefined symbol: \_PyErr\_ReplaceException\n”,  
“failed”: true,  
“module\_stderr”: “Traceback (most recent call last):\n File "/root/.ansible/tmp/ansible-tmp-1595260298.32-3449-114062721166446/AnsiballZ\_setup.py", line 102, in \n \_ansiballz\_main()\n File "/root/.ansible/tmp/ansible-tmp-1595260298.32-3449-114062721166446/AnsiballZ\_setup.py", line 20, in \_ansiballz\_main\n import tempfile\n File "/opt/rh/python27/root/usr/lib64/python2.7/tempfile.py", line 32, in \n import io as \_io\n File "/opt/rh/python27/root/usr/lib64/python2.7/io.py", line 51, in \n import \_io\nImportError: /opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/\_io.so: undefined symbol: \_PyErr\_ReplaceException\n”,  
“module\_stdout”: “”,  
“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,  
“rc”: 1  
}  
},  
“msg”: “The following modules failed to execute: setup\n”  
}

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [July 20, 2020, 4:04pm UTC](https://forum.ansible.com/t/the-following-modules-failed-to-execute-setup/33437/2 "2020-07-20T16:04:16Z")

</div>

It sounds like you have a `_io.so` file that was compiled against a different python version, from that which is attempting to use it.

Using python from an SCL as your ansible\_python\_interpreter is not just an easy 1 and done, by using the correct path. An SCL sets things like LD\_LIBRARY\_PATH and such when you enable it, that is not achieved by simply calling the binary in its place.

It looks like you are using `localhost`, which I will assume is “implicit localhost”[1] which automatically selects the python interpreter used by the playbook process, but since that work happens in a fork, I imagine it loses the SCL env vars required to use that SCL.

Overall, I’d probably recommend not using an SCL. Otherwise, you are going to have to jump through some hoops that are going to require that you better understand what needs to be done.

[1] [https://docs.ansible.com/ansible/latest/inventory/implicit\_localhost.html](https://docs.ansible.com/ansible/latest/inventory/implicit_localhost.html)

---

<div class="post-metadata">

**Author:** ![Nagesh\_sheregar](https://avatars.discourse-cdn.com/v4/letter/n/3ec8ea/32.png) [@Nagesh\_sheregar](https://forum.ansible.com/u/Nagesh_sheregar)\
**Post date:** [July 20, 2020, 4:18pm UTC](https://forum.ansible.com/t/the-following-modules-failed-to-execute-setup/33437/3 "2020-07-20T16:18:18Z")

</div>

Hi Matt,

i have enabled the scl python27 and it worked, is this not recommended ?

scl enable python27 bash

i have installed the pip using below process:

[https://access.redhat.com/solutions/1519803](https://access.redhat.com/solutions/1519803)

Thanks and Regards  
Nagesh
