# Unable to use yum on target RHEL 8.6 host that has python3.12

**URL:** <https://forum.ansible.com/t/unable-to-use-yum-on-target-rhel-8-6-host-that-has-python3-12/41162>\
**Category:** Get Help\
**Tags:** rhel\
**Created:** [March 20, 2025, 3:09pm UTC](https://forum.ansible.com/t/unable-to-use-yum-on-target-rhel-8-6-host-that-has-python3-12/41162 "2025-03-20T15:09:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mseto2](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@mseto2](https://forum.ansible.com/u/mseto2)\
**Post date:** [March 20, 2025, 3:09pm UTC](https://forum.ansible.com/t/unable-to-use-yum-on-target-rhel-8-6-host-that-has-python3-12/41162/1 "2025-03-20T15:09:50Z")

</div>

I am trying to use ansible (core 2.17.7) to run a playbook on a target RHEL 8.6 host. I know RHEL 8.6 ships with python3.6, but I have already compiled and built python3.12 on the target host, as well as updated the symlinks

I can run python --version on the target host and it does return Python 3.12.8

However, when I try running my playbook (even when specifying the ‘ansible\_python\_interpreter: /usr/bin/python’ var in the playbook), it keeps returning with the same error.

```auto
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: SyntaxError: future feature annotations is not defined
fatal: [10.17.12.133]: FAILED! => {"changed": false, "module_stderr": "Shared connection to 10.17.12.133 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n File \"<stdin>\", line 12, in <module>\r\n File \"<frozen importlib._bootstrap>\", line 971, in _find_and_load\r\n File \"<frozen importlib._bootstrap>\", line 951, in _find_and_load_unlocked\r\n File \"<frozen importlib._bootstrap>\", line 894, in _find_spec\r\n File \"<frozen importlib._bootstrap_external>\", line 1157, in find_spec\r\n File \"<frozen importlib._bootstrap_external>\", line 1131, in _get_spec\r\n File \"<frozen importlib._bootstrap_external>\", line 1112, in _legacy_get_spec\r\n File \"<frozen importlib._bootstrap>\", line 441, in spec_from_loader\r\n File \"<frozen importlib._bootstrap_external>\", line 544, in spec_from_file_location\r\n File \"/tmp/ansible_ansible.legacy.dnf_payload_xzwufs6b/ansible_ansible.legacy.dnf_payload.zip/ansible/module_utils/basic.py\", line 5\r\nSyntaxError: future feature annotations is not defined\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

```

Any help would be appreciated!

---

<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:** [March 20, 2025, 7:09pm UTC](https://forum.ansible.com/t/unable-to-use-yum-on-target-rhel-8-6-host-that-has-python3-12/41162/2 "2025-03-20T19:09:52Z")

</div>

Read [Issue with Ansible on Rocky Linux 8.10 (Python 3.12) – "future feature annotations is not defined" - #2 by sivel](https://forum.ansible.com/t/issue-with-ansible-on-rocky-linux-8-10-python-3-12-future-feature-annotations-is-not-defined/41117/2)

---

<div class="post-metadata">

**Author:** ![hugonz](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/hugonz/32/503_2.png) [@hugonz](https://forum.ansible.com/u/hugonz)\
**Post date:** [March 21, 2025, 5:01am UTC](https://forum.ansible.com/t/unable-to-use-yum-on-target-rhel-8-6-host-that-has-python3-12/41162/3 "2025-03-21T05:01:19Z")

</div>

Ansible has some python dependencies, including the `future` module. How did you install ansible on top of your python? using python 3.12’s pip command?

---

<div class="post-metadata">

**Author:** ![hugonz](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/hugonz/32/503_2.png) [@hugonz](https://forum.ansible.com/u/hugonz)\
**Post date:** [March 21, 2025, 5:04am UTC](https://forum.ansible.com/t/unable-to-use-yum-on-target-rhel-8-6-host-that-has-python3-12/41162/4 "2025-03-21T05:04:25Z")

</div>

Unless you’re willing to track down every single papercut, such as you not having the deps for ansible, you’re better off installing Python 3.12 in [The Recommended Way.](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/installing-and-using-dynamic-programming-languages_configuring-basic-system-settings#installing-and-using-dynamic-programming-languages_configuring-basic-system-settings)

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [March 24, 2025, 2:00pm UTC](https://forum.ansible.com/t/unable-to-use-yum-on-target-rhel-8-6-host-that-has-python3-12/41162/5 "2025-03-24T14:00:51Z")

</div>

Controller and target do not require the same Python, Ansible itself supports different version ranges of Python for controller vs targets.
