Last Updated: February 25, 2016
· rezigned

ValueError: unknown locale: UTF-8

Why it happen?

The default value of locale env in OSX was set with an incorrect value. To list all default locale, simply type the following command in terminal


You will see LC_CTYPE=UTF-8 in there which is incorrect. While other LC_* has no value assigned to (blank)


Add this line to ~/.bash_profile and re-open a terminal

export LC_ALL=en_US.UTF-8