are there ansible branches or configurations for python 3?

I’m new to ansible and naively installed ansible in a python 3 virtualenv.

While running one of the first commands in the “Getting Started” documentation:

`
ansible all -m ping -vvv

`

I ran into an error with ansible 2.0.0.2’s use of “basestring”, just like this stackoverflow user:

http://stackoverflow.com/q/34803467/399726

And (as the answer points out) ansible’s docs indeed say that ansible is not compatible with Python 3 on control machines:

Python 3 is a slightly different language than Python 2 and most Python programs (including Ansible) are not switching over yet.

Yet I also noticed ansible’s devel branch is being tested against Python 3.4 and Python 3.5, with the exception of tests that are skipped because

Python 3 is not supported on targets (yet)

I tried installing the latest devel branch (2.1.0 instead of PyPI’s 2.0.0.2 ) into my python 3 virtualenv but ran into the same error.

Are there ways to install a particular branch of ansible or configure it to work with Python 3?
Is there a branch under development that is working towards broader Python 3 compatibility?

Thanks in advance for any possible clarification. :slight_smile:

No special py3 branch, we are incrementally updating the development branch to add py3 compatibility.

Sadly we are not there yet, we do take PRs that help in this respect. Keep in mind that modules and module shared code (module_utils) must still be 2.4 compatible and the main Ansible executables have to keep 2.6 compatibility.

Hi - I am working on automating workflows on hypervisors like ESX, KVM and HyperV. Recent versions of these target hypervisors(e.g. ESX 6.5) have python 3.5+ support and Ansible is not working with Python 3.5+ version at all. I am big fan of Ansible and automated most of the end to end workflows on previous supervisors(having Python 2.x version). Could you please help me understand when Python 3.x support will be added into Ansible. After reading on this forum, it is found out that work is in progress. Is there any development version of Ansible available which will help me in running Ansible playbooks on ESX 6.5(having Python 3.5+ version) target hosts.

Thanks,
Prashant