Ansible is an application not a library so it is not a problem. Python allows to install multiple versions at the same time, for example you can have Python 2.7, 3.3, 3.4, 3.5 and 3.6 installed side by side and all will work fine without issues.
So you can have Python 2.7 installed for Ansible and 3.6 for your application.
I use Ansible via the API. I want to do it Python 3. I moved the ansible directory from /usr/local/python2 ... to /usr/local/python3 and then squashed out any bugs by hand.
It works! I'm using Ansible via the API in Python 3!