# Python compatibility between controller and managed nodes

**URL:** <https://forum.ansible.com/t/python-compatibility-between-controller-and-managed-nodes/36449>\
**Category:** Ansible Project\
**Created:** [March 16, 2022, 3:04pm UTC](https://forum.ansible.com/t/python-compatibility-between-controller-and-managed-nodes/36449 "2022-03-16T15:04:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gaetan\_QUENTIN](https://avatars.discourse-cdn.com/v4/letter/g/e9bcb4/32.png) [@Gaetan\_QUENTIN](https://forum.ansible.com/u/Gaetan_QUENTIN)\
**Post date:** [March 16, 2022, 3:04pm UTC](https://forum.ansible.com/t/python-compatibility-between-controller-and-managed-nodes/36449/1 "2022-03-16T15:04:10Z")

</div>

Hi,

A question about python compatibility between controller and managed node.

Do an ansible controller 2.9.XX with python 2.7.X can manage nodes where python 3.8 is installed?

The answer is not clear here: [https://docs.ansible.com/ansible/latest/reference\_appendices/python\_3\_support.html](https://docs.ansible.com/ansible/latest/reference_appendices/python_3_support.html)

Regards

---

<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:** [March 16, 2022, 5:17pm UTC](https://forum.ansible.com/t/python-compatibility-between-controller-and-managed-nodes/36449/2 "2022-03-16T17:17:49Z")

</div>

Hi,

> A question about python compatibility between controller and  
> managed node.
> 
> Do an ansible controller 2.9.XX with python 2.7.X can manage nodes  
> where python 3.8 is installed?

yes. There is no relation between the Python versions on controller and  
target (except that both have to be supported by Ansible).

Best,  
Felix

---

<div class="post-metadata">

**Author:** ![Gaetan\_QUENTIN](https://avatars.discourse-cdn.com/v4/letter/g/e9bcb4/32.png) [@Gaetan\_QUENTIN](https://forum.ansible.com/u/Gaetan_QUENTIN)\
**Post date:** [March 16, 2022, 6:12pm UTC](https://forum.ansible.com/t/python-compatibility-between-controller-and-managed-nodes/36449/3 "2022-03-16T18:12:56Z")

</div>

thank you for this response.

in my comprehension, ansible controller push some python code onto the target and this code is executed on the target.

does that mean that a 3.8 target recognize 2.7 code (we all know there is a compatibility rupture between 2.7 and 3.X) and can execute 2.7 code without problem?

is there an official documentation about that ?

Regards,

Gaétan

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [March 21, 2022, 8:56pm UTC](https://forum.ansible.com/t/python-compatibility-between-controller-and-managed-nodes/36449/4 "2022-03-21T20:56:05Z")

</div>

the code pushed is from modules and module\_utils, which are coded to  
be compatible with the widest range of python versions.  
You could also write modules in other languages (and people have in  
perl/ruby/bash/golang/etc) and use ansible to execute them, the code  
on the controller really does not have to match with the code  
executing on remotes.
