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,260 points
18,245 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!

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

Thanks!

answered Aug 7, 2020 by MD
• 95,460 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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,036 views
+2 votes
1 answer
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