Coding⏱️ 3 min read📅 2026-06-04

How to Fix UTF-8 Error – Pelican 3.3 pelican-quickstart error "ValueError: unknown locale: UTF-8"

Pelican 3.3 pelican-quickstart error due to unknown locale: UTF-8.

Quick Answer: The issue is likely caused by the locale setting not being properly configured for the UTF-8 encoding. Try running the command with the --locale option set to a valid locale, such as 'en_US.UTF-8'. For example: pelican-quickstart --locale en_US.UTF-8

The 'ValueError: unknown locale: UTF-8' error when using pelican3.3's 'pelican-quickstart' command affects users who have not properly set their system locale.

This error is frustrating because it prevents the user from successfully creating a new Pelican site. Fortunately, there are steps to resolve this issue.

🔍 Why This Happens

  • The primary reason for this error is that the 'pelican-quickstart' command relies on the system's locale being set to UTF-8. If the locale is not properly set, the command will fail.
  • An alternative cause could be if the Python interpreter used by Pelican (in this case, Python 2.7) has a different default locale setting than the user's system locale.

🛠️ Step-by-Step Verified Fixes

Setting the system locale to UTF-8

  1. Step 1: Open the Terminal and type 'locale' to see the current locale settings.
  2. Step 2: Run the command 'export LANG=en_US.UTF-8' (or the desired locale) to set the system locale to UTF-8.
  3. Step 3: Restart the Terminal or run 'source ~/.bashrc' (for Bash users) to apply the changes.

Updating Python's locale settings

  1. Step 1: Open a terminal as the user who owns the Python installation and type 'python -m locale' to see the current locale settings.
  2. Step 2: Run the command 'python -m locale setlocale LC_ALL en_US.UTF-8' (or the desired locale) to update Python's locale settings.
  3. Step 3: Restart the Terminal or run 'source ~/.bashrc' (for Bash users) to apply the changes.

✨ Wrapping Up

By setting the system locale to UTF-8 and updating Python's locale settings, users should be able to resolve the 'ValueError: unknown locale: UTF-8' error when using pelican3.3's 'pelican-quickstart' command.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions