gpt4 book ai didi

python-3.x - 在 Yocto 中更改区域设置

转载 作者:行者123 更新时间:2023-12-05 00:52:50 24 4
gpt4 key购买 nike

This is the error occur

由于 Yocto 中的默认语言环境设置为 POSIX,我得到如图所示的错误。现在我的问题是我不知道如何在 Yocto 中将区域设置更改为 en_US.utf-8

最佳答案

我也在用 yocto。尝试在 python3 上运行脚本时出现如下错误。

Traceback (most recent call last): ... RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment. Either switch to Python 2 or consult http://click.pocoo.org/python3/ for mitigation steps.



为了解决这个问题,首先我必须在你的 local.conf 中启用 UTF-8
GLIBC_GENERATE_LOCALES = "en_GB.UTF-8 en_US.UTF-8"

然后,当在目标上运行 locale -a 时,我得到了类似的东西。
C
en_GB
en_US
POSIX

为了确保本地人是 UTF-8,我使用了这个 link 中的 c 程序并得到了类似的东西:
C ->ANSI_X3.4-1968
en_GB ->UTF-8
en_US ->UTF-8
POSIX ->ANSI_X3.4-1968

最后
export LC_ALL=en_US
export LANG=en_US

在那之后,我对本地人没有任何错误。希望对你们中的任何人有所帮助。

关于python-3.x - 在 Yocto 中更改区域设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42090237/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com