5

I am trying to use Django's Admin documentation. I followed this tutorial and installed docutils. After installing I run Django development server through python manage.py runserver and get error unknown locale: UTF-8.

I solved issue as explained in this question:

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

But my question is: What is origin of this problem? It seems docutils has some compatibility problem with Python or something else?

Community
  • 1
  • 1
KenanBek
  • 999
  • 1
  • 14
  • 21

1 Answers1

2

This is old issue, but still happening on OSX El Capitan. The origin of this problem is that Python assumes locale environment variable to be in format of language_region.encoding. This assumption is strict on Python's part as OSX defaults to UTF-8 when valid language and region pair is not available.

Lengthy discussion about this issue at bugs.python.org

  • 1
    Same issue on OSX 10.14.2, fixed it by changing my primary language to `English (US)` instead of `English`. – EliadL Oct 10 '19 at 09:04