Python 3 Support
Note
Ansible supports Python version 3.5 and above only.
The easiest way to run /usr/bin/ansible under Python 3 is to install it with the Python3version of pip. This will make the default /usr/bin/ansible run with Python3:
Note
Individual Linux distribution packages may be packaged for Python2 or Python3. When running fromdistro packages you’ll only be able to use Ansible with the Python version for which it wasinstalled. Sometimes distros will provide a means of installing for several Python versions(via a separate package or via some commands that are run after install). You’ll need to checkwith your distro to see if that applies in your case.
See also
- Run your command or playbook:
Note that you can also use the -e command line option to manuallyset the python interpreter when you run a command. This can be useful if you want to test whethera specific module or playbook has any bugs under Python 3. For example:
We have spent several releases squashing bugs and adding new tests so that Ansible’s core featureset runs under both Python 2 and Python 3. However, bugs may still exist in edge cases and many ofthe modules shipped with Ansible are maintained by the community and not all of those may be portedyet.
If you find a bug running under Python 3 you can submit a bug report on . Be sure to mention Python3 in the bug report sothat the right people look at it.