in Uncategorized

locale.Error: unsupported locale setting

Fix python unsupported locale error in Debian based distro.

Error :

[email protected]:~$ sudo pip3 install boto3
Traceback (most recent call last):
 File "/usr/bin/pip3", line 11, in <module>
 sys.exit(main())
 File "/usr/lib/python3/dist-packages/pip/__init__.py", line 215, in main
 locale.setlocale(locale.LC_ALL, '')
 File "/usr/lib/python3.5/locale.py", line 594, in setlocale
 return _setlocale(category, locale)
locale.Error: unsupported locale setting

To Fix :

export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
sudo dpkg-reconfigure locales

Above 3 commands will reconfigure locales and that should solve the issue.