# \`ansible-playbook\` (\`ansible-core 2.17.1\`) fails on target with \`python 3.9\`

**URL:** <https://forum.ansible.com/t/ansible-playbook-ansible-core-2-17-1-fails-on-target-with-python-3-9/6700>\
**Category:** Get Help\
**Tags:** python, ansible-core\
**Created:** [June 21, 2024, 7:44am UTC](https://forum.ansible.com/t/ansible-playbook-ansible-core-2-17-1-fails-on-target-with-python-3-9/6700 "2024-06-21T07:44:25Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [July 13, 2024, 12:32pm UTC](https://forum.ansible.com/t/ansible-playbook-ansible-core-2-17-1-fails-on-target-with-python-3-9/6700/21 "2024-07-13T12:32:27Z")

</div>

I mainly used Debian because I’m way more familiar with it than with anything similar to RHEL. Do you have a new enough Python (3.9+) installed on your RHEL 8? If not, it won’t work anyway, thanks to how ansible-core works internally with Python modules, but it should be able to respawn with Python 3.6 with that module (as opposed to ansible-core’s dnf module, which won’t work with anything before Python 3.9).

---

<div class="post-metadata">

**Author:** ![Thulium-Drake](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/thulium-drake/32/833_2.png) [@Thulium-Drake](https://forum.ansible.com/u/Thulium-Drake)\
**Post date:** [July 14, 2024, 9:43am UTC](https://forum.ansible.com/t/ansible-playbook-ansible-core-2-17-1-fails-on-target-with-python-3-9/6700/22 "2024-07-14T09:43:47Z")

</div>

Yes, this particular host is my RHEL8 Ansible Engine controller in my lab environment. It runs Ansible 2.16 itself 🙂 and has Python 3.11 available for all other stuff.

But as I mentioned earlier, to me this is why EEs were invented 😉

---

<div class="post-metadata">

**Author:** ![jgoossens](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jgoossens/32/7122_2.png) [@jgoossens](https://forum.ansible.com/u/jgoossens)\
**Post date:** [January 2, 2025, 4:58pm UTC](https://forum.ansible.com/t/ansible-playbook-ansible-core-2-17-1-fails-on-target-with-python-3-9/6700/23 "2025-01-02T16:58:59Z")

</div>

So is there any fix or workaround? Since upgrade to Ansible 2.17 all our Red Hat 8 based systems fail to deploy ☹

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [January 2, 2025, 5:21pm UTC](https://forum.ansible.com/t/ansible-playbook-ansible-core-2-17-1-fails-on-target-with-python-3-9/6700/24 "2025-01-02T17:21:10Z")

</div>

Unfortunately, the workaround is to use Ansible-core 2.16.

Edit: And the problem isn’t just that Ansible _itself_ doesn’t support python3.6 anymore, but that other python libraries that Ansible depends on no longer supports python3.6, including some required for the dnf module. Unlike other modules, we can’t just install a supported python on the remote RHEL8 hosts either, because the python-dnf library is only available through the platform-python (which is python3.6, and cannot be changed).

---

<div class="post-metadata">

**Author:** ![sfleisch](https://avatars.discourse-cdn.com/v4/letter/s/ed8c4c/32.png) [@sfleisch](https://forum.ansible.com/u/sfleisch)\
**Post date:** [March 24, 2025, 1:41pm UTC](https://forum.ansible.com/t/ansible-playbook-ansible-core-2-17-1-fails-on-target-with-python-3-9/6700/25 "2025-03-24T13:41:35Z")

</div>

My currently preferred workaround:

```auto
    - name: "install tools"
      ansible.builtin.command: "dnf install -y nano telnet rsync wget htop tree"

```

[Previous page](https://forum.ansible.com/t/ansible-playbook-ansible-core-2-17-1-fails-on-target-with-python-3-9/6700.md?page=1)
