If you’re facing the following error with a long traceback before it when you’re trying to include the the matplotlib ( This happens only in OSX / macOS ! ), you have to alter some environment variables related to the locale
ValueError: unknown locale: UTF-8
The fix to the problem is to add two environment variable to the bash profile of your shell.
Typically the bash profile, which is being used by the macOS, will be at ~/.bash_profile. Open the file and add the following lines towards the end of it:
And now, restart your terminal window!