-k_93g
Last Updated: October 13, 2018
·
114.7K
· masnun

Mac OS X: ValueError: unknown locale: UTF-8 in Python

If you have faced the error on MacOS X, here's the quick fix - add these lines to your ~/.bash_profile:

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

12 Responses
Add your response

1016

Thanks a lot!

over 1 year ago ·
5135

Thanks, it worked for me on .profile

over 1 year ago ·
11282

Thanks, sir!

over 1 year ago ·
13445

Nice solved a problem with kivy packaging for Mac OSX, which halted because of this error (OSX 10.9.2 / Python 2.7.6 / PyInstaller 2.1)

over 1 year ago ·
16415

It does help on Mac. (OSX 10.9.4-Anaconda 2.0.1) :-)

over 1 year ago ·
18217

Hey. I have heard this for million times "If you have faced the error on MacOS X, here's the quick fix - add these lines to your ~/.bash_profile:" but how to? I'm very newbie please tell me very step by step. I'm using OS X yosemite

over 1 year ago ·
18228

The ".bash_profile" is in "~" or your home directory. You can just type:

$ vim ~/.bash_profile

To have it open in Vim, for example.

over 1 year ago ·
20832

It worked.

over 1 year ago ·
24899

After opening Vim how do one add the lines? Please

over 1 year ago ·
27753

Worked, thank you.

over 1 year ago ·
27776

Thanks! Worked for me :)

over 1 year ago ·
28171

Thanks a million :+1:

over 1 year ago ·
Filed Under