Failed to import the required Python library (Docker SDK for Python: docker (Python >= 2.7) or docker-py (Python 2.6))

0 votes

Hi Guys,

I am trying to run Ansible-playbook in my controller node, but it is showing me the below error.

FAILED! => {"changed": false, "msg": "Failed to import the required Python library (Docker SDK for Python: docker (Python >= 2.7) or docker-py (Python 2.6)) on master's Python /usr/bin/python.

How can I solve this error?

Aug 7 in Ansible by akhtar
• 25,030 points
971 views

1 answer to this question.

0 votes

Hi@akhtar,

You may get this error if the required library is installed, but Ansible is using the wrong Python interpreter. So here you need to reinstall the docker SDK in your system using the below-given command.

$ pip3 install docker

I hope this will solve your error.

answered Aug 7 by MD
• 56,480 points

Related Questions In Ansible

0 votes
1 answer
+1 vote
3 answers
+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 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
677 views
+2 votes
1 answer