While running ansible playbook, I encountered this error
Traceback (most recent call last):
File "/usr/local/bin/ansible-playbook", line 110, in <module>
display.error("Unexpected Exception: %s" % to_unicode(e), wrap_text=False)
File "/Library/Python/2.7/site-packages/ansible/utils/display.py", line 261, in error
self.display(new_msg, color=C.COLOR_ERROR, stderr=True)
File "/Library/Python/2.7/site-packages/ansible/utils/display.py", line 124, in display
msg2 = to_bytes(msg2, encoding=self._output_encoding(stderr=stderr))
File "/Library/Python/2.7/site-packages/ansible/utils/unicode.py", line 208, in to_bytes
return obj.encode(encoding, errors)
LookupError: unknown encoding:
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
I added these environmental variables and the problem was solved.
$ export LANG=en_US.UTF-8
$ export LC_ALL=en_US.UTF-8
More information can be found in the issue here ansible/ansible#14053
Thanks!