Error saying msg Failed to import docker-py - No module named requests packages urllib3 Try pip install docker-py

0 votes

I'm trying to build a docker image using the docker_image module of ansible.

my playbook:

 - name: Install dependent python modules
   pip:
     name: "{{item}}"
     state: present
   with_items:
    - docker-py

 - name: Build container image for api
   docker_image:
      name: api
      path: /home/abc/api/ #location of my Dockerfile

Ans I encountered this error:

"msg": "Failed to import docker-py - No module named 'requests.packages.urllib3'. Try `pip install docker-py`"
Feb 9, 2019 in Ansible by Hari
8,148 views

1 answer to this question.

0 votes

Hey @Hari, In addition to docker-py install the following packages:

- requests 
- urllib3
answered Feb 9, 2019 by Monish
still the same issue.
Hey @Athar, what Ansible version are you using?

Related Questions In Ansible

0 votes
1 answer
0 votes
1 answer

Error saying "ImportError: No module named ansible.playbook" when installing ansible on aws

Hey @Niana, I don't think you have ...READ MORE

answered Feb 4, 2019 in Ansible by Anushri

edited Feb 6, 2019 5,568 views
+2 votes
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
7,739 views
0 votes
1 answer
0 votes
2 answers

Error saying "ImportError: No module named yaml"

actually this related python pckage in order ...READ MORE

answered Jul 18, 2020 in Ansible by shivanand
19,251 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP