pysteps icon indicating copy to clipboard operation
pysteps copied to clipboard

UnicodeDecodeError: 'gbk' codec can't decode byte 0x93 in position 5924: illegal multibyte sequence

Open xinzhengcn1995 opened this issue 1 year ago • 1 comments

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [19 lines of output] [1/2] Cythonizing pysteps/motion/_proesmans.pyx [2/2] Cythonizing pysteps/motion/_vet.pyx Traceback (most recent call last): File "D:\software\anaconda3\envs\QC\lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in main() File "D:\software\anaconda3\envs\QC\lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "D:\software\anaconda3\envs\QC\lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 118, in get_requires_for_build_wheel return hook(config_settings) File "C:\Users\xinzh\AppData\Local\Temp\pip-build-env-my7zwmy6\overlay\Lib\site-packages\setuptools\build_meta.py", line 332, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=[]) File "C:\Users\xinzh\AppData\Local\Temp\pip-build-env-my7zwmy6\overlay\Lib\site-packages\setuptools\build_meta.py", line 302, in _get_build_requires self.run_setup() File "C:\Users\xinzh\AppData\Local\Temp\pip-build-env-my7zwmy6\overlay\Lib\site-packages\setuptools\build_meta.py", line 516, in run_setup super().run_setup(setup_script=setup_script) File "C:\Users\xinzh\AppData\Local\Temp\pip-build-env-my7zwmy6\overlay\Lib\site-packages\setuptools\build_meta.py", line 318, in run_setup exec(code, locals()) File "", line 79, in UnicodeDecodeError: 'gbk' codec can't decode byte 0x93 in position 5924: illegal multibyte sequence [end of output]

xinzhengcn1995 avatar Oct 21 '24 09:10 xinzhengcn1995

中文: 我也遇到相同的问题 原因应该是一些代码没有显式指定 encoding=utf-8,导致 build 的时候默认使用了系统的 encoding 设置,即 gbk,进而导致解码失败

解决方法 (Windows 上) 是修改系统的 encoding 设置,步骤为:控制面板 -> 时钟和区域 -> 区域 -> 管理 -> 更改系统区域设置 -> 勾选 “Beta 版:使用 Unicode UTF 8 提供全球语言支持”

English: Same issue here.

The likely cause is that some code doesn't explicitly specify encoding=utf-8, causing the build process resort to the system's default encoding setting, which is GBK, leading to a decoding failure.

The solution (on Windows) is to modify the system's encoding settings. The steps are: Control Panel -> Clock and Region -> Region -> Administrative -> Change system locale -> Check "Beta: Use Unicode UTF-8 for worldwide language support".

VioletsOleander avatar Jul 09 '25 09:07 VioletsOleander