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, 2020 in Ansible by akhtar
• 38,210 points

1 answer to this question.

0 votes


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!

If you need to learn more about Python, It's recommended to join Python Training today.


answered Aug 7, 2020 by MD
• 95,300 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
+2 votes
1 answer