Last Updated: September 29, 2021
·
173.9K
· 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

13 Responses
Add your response

Thanks a lot!

over 1 year ago ·

Thanks, it worked for me on .profile

over 1 year ago ·

Thanks, sir!

over 1 year ago ·

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 ·

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

over 1 year ago ·

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 ·

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 ·

It worked.

over 1 year ago ·

After opening Vim how do one add the lines? Please

over 1 year ago ·

Worked, thank you.

over 1 year ago ·

Thanks! Worked for me :)

over 1 year ago ·

Thanks a million :+1:

over 1 year ago ·

Thanks!!

10 months ago ·