# Ansible-core requires a minimum of Python2 version 2.7 or Python3 version 3.5. Current version: 2.6.6

**URL:** <https://forum.ansible.com/t/ansible-core-requires-a-minimum-of-python2-version-2-7-or-python3-version-3-5-current-version-2-6-6/3312>\
**Category:** Get Help\
**Created:** [January 14, 2024, 6:31pm UTC](https://forum.ansible.com/t/ansible-core-requires-a-minimum-of-python2-version-2-7-or-python3-version-3-5-current-version-2-6-6/3312 "2024-01-14T18:31:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bentech4u](https://avatars.discourse-cdn.com/v4/letter/b/da6949/32.png) [@bentech4u](https://forum.ansible.com/u/bentech4u)\
**Post date:** [January 14, 2024, 6:31pm UTC](https://forum.ansible.com/t/ansible-core-requires-a-minimum-of-python2-version-2-7-or-python3-version-3-5-current-version-2-6-6/3312/1 "2024-01-14T18:31:35Z")

</div>

Hello,

i am new tho this community and recently i have upgraded my ansible to 2.15, here is my anisble details:  
ansible-config [core 2.15.6]  
config file = /etc/ansible/ansible.cfg  
configured module search path = [‘/root/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/lib/python3.9/site-packages/ansible  
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections  
executable location = /bin/ansible-config  
python version = 3.9.18 (main, Sep 7 2023, 00:00:00) [GCC 11.4.1 20230605 (Red Hat 11.4.1-2)] (/usr/bin/python3)  
jinja version = 3.1.2  
libyaml = True

but my target server is redhat 6 and python veresion is 2.6.6, while running a playbook, i am getting below error:

```auto
{
  "ansible_facts": {},
  "msg": "The following modules failed to execute: ansible.legacy.setup\n",
  "failed_modules": {
    "ansible.legacy.setup": {
      "failed": true,
      "msg": "ansible-core requires a minimum of Python2 version 2.7 or Python3 version 3.5. Current version: 2.6.6 (r266:84292, Aug 9 2016, 06:11:56) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)]",
      "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
      }
    }
  },
  "_ansible_verbose_override": true,
  "_ansible_no_log": null,
  "changed": false
}

```

how can i fix this without downgrading ansible

---

<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:** [January 14, 2024, 6:51pm UTC](https://forum.ansible.com/t/ansible-core-requires-a-minimum-of-python2-version-2-7-or-python3-version-3-5-current-version-2-6-6/3312/2 "2024-01-14T18:51:34Z")

</div>

You can install a newer Python version on your RHEL 6 server.

The only alternative is sticking to the [`raw` action (which makes Ansible not very useful)](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/raw_module.html), or downgrade ansible-core to an older version.

---

<div class="post-metadata">

**Author:** ![bentech4u](https://avatars.discourse-cdn.com/v4/letter/b/da6949/32.png) [@bentech4u](https://forum.ansible.com/u/bentech4u)\
**Post date:** [January 14, 2024, 7:27pm UTC](https://forum.ansible.com/t/ansible-core-requires-a-minimum-of-python2-version-2-7-or-python3-version-3-5-current-version-2-6-6/3312/3 "2024-01-14T19:27:46Z")

</div>

Thanks for the response,

i cannot upgrade the python version of redhat 6 server as it is production and current python is in use, the application is very old and there is an upgrade coming in coming years

the current ansible is full tower installation where i was on old version of AWX. is it possible/recommended to downgrade the ansible to 2.12 ?

---

<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:** [January 14, 2024, 7:42pm UTC](https://forum.ansible.com/t/ansible-core-requires-a-minimum-of-python2-version-2-7-or-python3-version-3-5-current-version-2-6-6/3312/4 "2024-01-14T19:42:42Z")

</div>

If you’re using Execution Environments, using an older ansible-core version like 2.12 shouldn’t be a problem.

About Python 2.6/2.7 on RHEL 6: I guess it should be able to install Python 2.7 _next to_ Python 2.6. No idea whether that has some unexpected impact on your application though…

---

<div class="post-metadata">

**Author:** ![bentech4u](https://avatars.discourse-cdn.com/v4/letter/b/da6949/32.png) [@bentech4u](https://forum.ansible.com/u/bentech4u)\
**Post date:** [January 14, 2024, 9:06pm UTC](https://forum.ansible.com/t/ansible-core-requires-a-minimum-of-python2-version-2-7-or-python3-version-3-5-current-version-2-6-6/3312/5 "2024-01-14T21:06:37Z")

</div>

i have downgraded ansible-core to ansible-core-2.12.2-1 , still same issue

---

<div class="post-metadata">

**Author:** ![WyoMurf](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wyomurf/32/3588_2.png) [@WyoMurf](https://forum.ansible.com/u/WyoMurf)\
**Post date:** [May 28, 2024, 2:16pm UTC](https://forum.ansible.com/t/ansible-core-requires-a-minimum-of-python2-version-2-7-or-python3-version-3-5-current-version-2-6-6/3312/6 "2024-05-28T14:16:46Z")

</div>

> [@felixfontein](#):
>
> …

We are using ansible 2.10.17 successfully with old centOS6 hosts just fine!

---

<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:** [May 28, 2024, 9:17pm UTC](https://forum.ansible.com/t/ansible-core-requires-a-minimum-of-python2-version-2-7-or-python3-version-3-5-current-version-2-6-6/3312/7 "2024-05-28T21:17:47Z")

</div>

@WyoMurf while you can also use ansible-base 2.10, I would rather use ansible-core 2.12 in your case since that also supports Python 2.6, but has some improvements / features / bugfixes that ansible-base 2.10 does not have, like for example role argument spec validation (introduced in 2.11, improved in 2.12).

---

<div class="post-metadata">

**Author:** ![Borg](https://avatars.discourse-cdn.com/v4/letter/b/90ced4/32.png) [@Borg](https://forum.ansible.com/u/Borg)\
**Post date:** [October 17, 2024, 1:59pm UTC](https://forum.ansible.com/t/ansible-core-requires-a-minimum-of-python2-version-2-7-or-python3-version-3-5-current-version-2-6-6/3312/8 "2024-10-17T13:59:20Z")

</div>

I dont see this as solved but I also came here with the same problem, though my solution is going to be to install python3 on the rhel6s and add a variable to my inventories for the RHEL6 and some RHEL7s we have bound to 2.6.  
Var should be  
`ansible_python_interpreter: /user/bin/python3`  
or where ever python installed at, as long as you dont change the servers configs to source python3 all will work still.
