Repository navigation
Windows 安装出现 UnicodeDecodeError 编码错误
#321
suejie02
started this conversation in
Show and tell
Replies: 1 comment
|
感谢报告,已定位:仓库的 requirements 文件含中文注释但没有编码声明,pip 24.x 及更早版本在中文 Windows 上会按 GBK 解码而报错(pip ≥25 默认先按 UTF-8 读取,不受影响)。已在两份 requirements 首行加上 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
UnicodeDecodeError: 'gbk' codec can't decode byte 0xae in position 306: illegal multibyte sequence笔者这台 Windows 上的 Python/pip 按系统区域设置用了 GBK 来读。文件中遇到 GBK 无法识别的字节,需要在powershell面板安装前设置
$env:PYTHONUTF8 = "1"指定UTF8编码All reactions