# Python 2, Python 3, Conda, and ansible modules dnf and docker\_container

**URL:** <https://forum.ansible.com/t/python-2-python-3-conda-and-ansible-modules-dnf-and-docker-container/32363>\
**Category:** Ansible Project\
**Tags:** rhel\
**Created:** [March 2, 2020, 2:05pm UTC](https://forum.ansible.com/t/python-2-python-3-conda-and-ansible-modules-dnf-and-docker-container/32363 "2020-03-02T14:05:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julien\_Cochennec](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@Julien\_Cochennec](https://forum.ansible.com/u/Julien_Cochennec)\
**Post date:** [March 2, 2020, 2:05pm UTC](https://forum.ansible.com/t/python-2-python-3-conda-and-ansible-modules-dnf-and-docker-container/32363/1 "2020-03-02T14:05:02Z")

</div>

Hi,  
When using Docker CE on RHEL 7, installed whith Ansible (python 2.7 on target), docker\_container module fails, saying I should install docker or docker-py, but I can’t find a way to make it work.  
Python 2.7 being unsupported since January, I tried to switch to Python 3.  
The yum module says it is deprecated and suggets I use dnf with Python 3.  
I can’t find any package (RPM) python3-dnf, even dnf can’t find it, is there a way to make it work, please?  
So I switched to miniconda to provide a Python distribution independant from Red Hat as neither Python2 nor Python3 worked.  
I can’t find a way to make dnf module work when installing ansible and dnf with pip with miniconda.

So, my question is this :  
Is there a LTS way to use both docker\_container and yum or dnf modules on RHEL7? I f yes, which Python should I use?

I’m getting really worried about all those incompatibilities, there should exist a way to keep it simple without spending hours resolving conflicts and deprecation problems.  
Thank you guys.
