# Getting ansible\_python\_interpreter error in mac local machine

**URL:** <https://forum.ansible.com/t/getting-ansible-python-interpreter-error-in-mac-local-machine/34744>\
**Category:** Ansible Project\
**Created:** [March 8, 2021, 7:47pm UTC](https://forum.ansible.com/t/getting-ansible-python-interpreter-error-in-mac-local-machine/34744 "2021-03-08T19:47:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jaydip\_Jadeja](https://avatars.discourse-cdn.com/v4/letter/j/a88e4f/32.png) [@Jaydip\_Jadeja](https://forum.ansible.com/u/Jaydip_Jadeja)\
**Post date:** [March 8, 2021, 7:47pm UTC](https://forum.ansible.com/t/getting-ansible-python-interpreter-error-in-mac-local-machine/34744/1 "2021-03-08T19:47:18Z")

</div>

zsh shell : ansible-playbook -D -l ‘local’ -e “cluster=xxx1” cluster.yml  
error : “msg”: “Failed to import the required Python library (openshift) on MacBook-Pro.local’s Python /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python. Please read module documentation and install in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible\_python\_interpreter”

when I pass extra argument command : ansible-playbook -D -l ‘local’ -e “cluster=xxx1” xxx.yml -e ansible\_python\_interpreter=/usr/bin/python3

above playbook working without error

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [March 8, 2021, 9:33pm UTC](https://forum.ansible.com/t/getting-ansible-python-interpreter-error-in-mac-local-machine/34744/2 "2021-03-08T21:33:53Z")

</div>

I don't see any question, so I will go ahead and assume you are  
surprised about the python/python3 difference.  
Please read: [https://docs.ansible.com/ansible/latest/reference\_appendices/interpreter\_discovery.html](https://docs.ansible.com/ansible/latest/reference_appendices/interpreter_discovery.html)
