Posted on

Reproduce

>>> import locale
>>> locale.setlocale(locale.LC_ALL,"en_US.UTF-8")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/root/anaconda/envs/py37/lib/python3.7/locale.py", line 608, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting
>>> exit()

Fix

sudo apt-get install language-pack-id
sudo dpkg-reconfigure locales

Verification

>>> import locale
>>> locale.setlocale(locale.LC_ALL,'en_US.UTF-8')
'en_US.UTF-8'
>>> exit()

Leave a Reply

Your email address will not be published. Required fields are marked *