Fixing ValueError('unknown locale: %s' % localename) in Python

You get 3 guesses for what the solution could be...

If you’re getting raise ValueError('unknown locale: %s' % localename) when executing your Python script, there is a simple fix. Before executing your script, run the following:

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

It might make your life easier just to add it to your ~/.bash_profile file.

← previous post
Getting Started with Xinetd

next post →
The Ultimate Guide to Using Mail in Linux

38TechnologyView source