# Docker module error

**URL:** <https://forum.ansible.com/t/docker-module-error/30357>\
**Category:** Ansible Project\
**Created:** [May 17, 2019, 6:49am UTC](https://forum.ansible.com/t/docker-module-error/30357 "2019-05-17T06:49:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![idemia\_pune](https://avatars.discourse-cdn.com/v4/letter/i/67e7ee/32.png) [@idemia\_pune](https://forum.ansible.com/u/idemia_pune)\
**Post date:** [May 17, 2019, 6:49am UTC](https://forum.ansible.com/t/docker-module-error/30357/1 "2019-05-17T06:49:01Z")

</div>

Hi,

Please help to get this resolved, tried all most everything.

Ansible Version:

ansible 2.7.10

config file = /etc/ansible/ansible.cfg

configured module search path = [‘/home/stack/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]

ansible python module location = /home/stack/.local/lib/python3.6/site-packages/ansible

executable location = /home/stack/.local/bin/ansible

python version = 3.6.7 (default, Oct 22 2018, 11:32:17) [GCC 8.2.0]

List

ll drop support for Python 2.7.

**docker** -compose 1.9.0

**docker** -py 1.10.6

**docker** -pycreds 0.4.0

**docker** pty 0.4.1

python --version

Python 2.7.15rc1

Error

FAILED! =\> {“changed”: false, “msg”: “Failed to import docker or docker-py - No module named requests.exceptions. Try `pip install docker` or `pip install docker-py` (Python 2.6)”}

FAILED! =\> {“changed”: false, “msg”: “Failed to import docker or docker-py - No module named docker. Try `pip install docker` or `pip install docker-py` (Python 2.6)”}

---

<div class="post-metadata">

**Author:** ![Daniel\_Whitley1](https://avatars.discourse-cdn.com/v4/letter/d/f6c823/32.png) [@Daniel\_Whitley1](https://forum.ansible.com/u/Daniel_Whitley1)\
**Post date:** [May 17, 2019, 11:52am UTC](https://forum.ansible.com/t/docker-module-error/30357/2 "2019-05-17T11:52:40Z")

</div>

Hello-  
Without all the info, this looks similar to something I ran into. Try:

pip3 install docker

This will install the docker Python module for the version of Python that Ansible is using (3.6.7).

Better yet, have a task in your playbook install it prior to using the docker Ansible module. Using the pip Ansible module will install the correct version.  
-Daniel
