Getting ansible_python_interpreter error in mac local machine

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

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