weditor安装出现“UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xad in position 825: illegal multiby”

本文针对Windows环境下Python安装时出现的UnicodeDecodeError,详细阐述了错误原因——GBK编码冲突,提供了解决方案——设置PYTHONUTF8环境变量。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

报错内容

UnicodeDecodeError: 'gbk' codec can't decode byte 0xad in position 825: illegal multibyte sequence

报错原因

Windows字符编码,导致的安装报错

解决方式

系统环境变量新增PYTHONUTF8变量值,并且设置为1
系统环境变量
参考内容

Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [30 lines of output] C:\Users\26289\AppData\Local\Temp\pip-build-env-_uaj_44a\normal\Lib\site-packages\pbr\util.py:75: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81. import pkg_resources Error parsing Traceback (most recent call last): File "C:\Users\26289\AppData\Local\Temp\pip-build-env-_uaj_44a\normal\Lib\site-packages\pbr\core.py", line 105, in pbr attrs = util.cfg_to_args(path, dist.script_args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\26289\AppData\Local\Temp\pip-build-env-_uaj_44a\normal\Lib\site-packages\pbr\util.py", line 272, in cfg_to_args pbr.hooks.setup_hook(config) File "C:\Users\26289\AppData\Local\Temp\pip-build-env-_uaj_44a\normal\Lib\site-packages\pbr\hooks\__init__.py", line 25, in setup_hook metadata_config.run() File "C:\Users\26289\AppData\Local\Temp\pip-build-env-_uaj_44a\normal\Lib\site-packages\pbr\hooks\base.py", line 27, in run self.hook() File "C:\Users\26289\AppData\Local\Temp\pip-build-env-_uaj_44a\normal\Lib\site-packages\pbr\hooks\metadata.py", line 25, in hook self.config['version'] = packaging.get_version( ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\26289\AppData\Local\Temp\pip-build-env-_uaj_44a\normal\Lib\site-packages\pbr\packaging.py", line 854, in get_version version = _get_version_from_pkg_metadata(package_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\26289\AppData\Local\Temp\pip-build-env-_uaj_44a\normal\Lib\site-packages\pbr\packaging.py", line 822, in _get_version_from_pkg_metadata pkg_metadata = email.message_from_file(pkg_metadata_file) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\toos\python\Lib\email\__init__.py", line 53, in message_from_file return Parser(*args, **kws).parse(fp) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\toos\python\Lib\email\parser.py", line 52, in parse while data := fp.read(8192): ^^^^^^^^^^^^^ UnicodeDecodeError: 'gbk' codec can't decode byte 0xad in position 795: illegal multibyte sequence error in setup command: Error parsing C:\Users\26289\AppData\Local\Temp\pip-install-yrpn9_um\weditor\setup.cfg: UnicodeDecodeError: 'gbk' codec can't decode byte 0xad in position 795: illegal multibyte sequence [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. [notice] A new release of pip is available: 25.0.1 -> 25.1.1 [notice] To update, run: python.exe -m pip install --upgrade pip error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> weditor note: This is an issue with the package mentioned above, not pip. hint: See above for details.
最新发布
06-29
Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [30 lines of output] C:\Users\26289\AppData\Local\Temp\pip-build-env-wl0w0p52\normal\Lib\site-packages\pbr\util.py:75: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81. import pkg_resources Error parsing Traceback (most recent call last): File "C:\Users\26289\AppData\Local\Temp\pip-build-env-wl0w0p52\normal\Lib\site-packages\pbr\core.py", line 105, in pbr attrs = util.cfg_to_args(path, dist.script_args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\26289\AppData\Local\Temp\pip-build-env-wl0w0p52\normal\Lib\site-packages\pbr\util.py", line 272, in cfg_to_args pbr.hooks.setup_hook(config) File "C:\Users\26289\AppData\Local\Temp\pip-build-env-wl0w0p52\normal\Lib\site-packages\pbr\hooks\__init__.py", line 25, in setup_hook metadata_config.run() File "C:\Users\26289\AppData\Local\Temp\pip-build-env-wl0w0p52\normal\Lib\site-packages\pbr\hooks\base.py", line 27, in run self.hook() File "C:\Users\26289\AppData\Local\Temp\pip-build-env-wl0w0p52\normal\Lib\site-packages\pbr\hooks\metadata.py", line 25, in hook self.config['version'] = packaging.get_version( ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\26289\AppData\Local\Temp\pip-build-env-wl0w0p52\normal\Lib\site-packages\pbr\packaging.py", line 854, in get_version version = _get_version_from_pkg_metadata(package_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\26289\AppData\Local\Temp\pip-build-env-wl0w0p52\normal\Lib\site-packages\pbr\packaging.py", line 822, in _get_version_from_pkg_metadata pkg_metadata = email.message_from_file(pkg_metadata_file) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\toos\python\Lib\email\__init__.py", line 53, in message_from_file return Parser(*args, **kws).parse(fp) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\toos\python\Lib\email\parser.py", line 52, in parse while data := fp.read(8192): ^^^^^^^^^^^^^ UnicodeDecodeError: 'gbk' codec can't decode byte 0xad in position 645: illegal multibyte sequence error in setup command: Error parsing C:\Users\26289\AppData\Local\Temp\pip-install-1a2jr5o2\weditor_634b46dd75ad4df08dd98c00a710ba78\setup.cfg: UnicodeDecodeError: 'gbk' codec can't decode byte 0xad in position 645: illegal multibyte sequence [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. [notice] A new release of pip is available: 25.0.1 -> 25.1.1 [notice] To update, run: python.exe -m pip install --upgrade pip error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details.
06-29
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值