Home > Backend Development > Python Tutorial > How to Fix \'ValueError: unknown locale: UTF-8\' in Pelican-Quickstart with Version 3.3?

How to Fix \'ValueError: unknown locale: UTF-8\' in Pelican-Quickstart with Version 3.3?

DDD
Release: 2024-10-20 06:04:02
Original
1037 people have browsed it

How to Fix

Pelican 3.3 pelican-quickstart Error: "ValueError: unknown locale: UTF-8"

When attempting to run "pelican-quickstart" with Pelican version 3.3, users may encounter the following error:

ValueError: unknown locale: UTF-8
Copy after login

This error stems from a known bug in Python that is triggered by Pelican's reliance on the docutils package.

Solution:

To resolve this issue, add the following lines to your ~/.bash_profile:

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
Copy after login

This workaround explicitly sets the locale environment variables, overriding the problematic Python assumptions.

Note: The default settings in the provided solution assume English and the United States. If necessary, you can update the values to match your specific locale preferences. To determine the available options for your locale, run the following command:

locale -a
Copy after login

The above is the detailed content of How to Fix \'ValueError: unknown locale: UTF-8\' in Pelican-Quickstart with Version 3.3?. For more information, please follow other related articles on the PHP Chinese website!

source:php
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template