安装 mesh2hrtf 时出现的,安装包链接如下: https://github.com/Any2HRTF/Mesh2HRTF/wiki/Installation_2#mesh2hrtf-python-package-installation
报错信息如下: PS C:\Mesh2HRTF\Mesh2HRTF1.1.1> pip install -e . Defaulting to user installation because normal site-packages is not writeable Obtaining file:///C:/Mesh2HRTF/Mesh2HRTF1.1.1 Installing build dependencies ... done Checking if build backend supports build_editable ... done Getting requirements to build editable ... error error: subprocess-exited-with-error
× Getting requirements to build editable did not run successfully. │ exit code: 1 ╰─> [23 lines of output] Traceback (most recent call last): File "C:\Users\78347\AppData\Roaming\Python\Python311\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in <module> main() File "C:\Users\78347\AppData\Roaming\Python\Python311\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\78347\AppData\Roaming\Python\Python311\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 132, in get_requires_for_build_editable return hook(config_settings) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\78347\AppData\Local\Temp\pip-build-env-b58n0u1h\overlay\Lib\site-packages\setuptools\build_meta.py", line 441, in get_requires_for_build_editable return self.get_requires_for_build_wheel(config_settings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\78347\AppData\Local\Temp\pip-build-env-b58n0u1h\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=['wheel']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\78347\AppData\Local\Temp\pip-build-env-b58n0u1h\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires self.run_setup() File "C:\Users\78347\AppData\Local\Temp\pip-build-env-b58n0u1h\overlay\Lib\site-packages\setuptools\build_meta.py", line 480, in run_setup super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script) File "C:\Users\78347\AppData\Local\Temp\pip-build-env-b58n0u1h\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup exec(code, locals()) File "<string>", line 9, in <module> UnicodeDecodeError: 'gbk' codec can't decode byte 0x93 in position 3274: illegal multibyte sequence [end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error
× Getting requirements to build editable did not run successfully. │ exit code: 1 ╰─> See above for output.
2
NoOneNoBody 338 天前
正确方法是去官方搜 issue ,或者提问
自己排查的话,就是编码不合,需要确保读取的文件、输出的文件、console 是同一种编码 windows console 默认跟随系统编码,文件如果没有声明也是默认系统编码 gbk 表示你是中文 windows ,或者安装了中文语言包,且把中文( cp936 )作为默认编码 note: This error originates from a subprocess, and is likely not a problem with pip. 这句话应该是说运行(安装)过程调用了一个子进程,子进程的输出返回给主进程时产生错误,盲猜是 console 编码问题 可以在安装前,console 运行 chcp 65001 这行命令 如果不行可以试试 iso-8859-1 ,但还是建议询问官方 PS: 一般替代方案,备注,替代并非绝对全等的,只是说大部分可行,细微差别请查阅资料 iso-8859-1 -> windows:windows-1252, python:latin-1 #纯英文 gbk: windows: cp936, python:gbk #简体中文 uft-8: windows: cp65001, python: utf8 另外 utf 在 windows 默认是指 utf-16 ,ansi 默认是 8859-1 ,这是以前的事,但 windows 11 后增加了可以修改系统默认 utf-8 的功能,utf 的默认指向可能已经改变,请以最新文档为准。补充警告:虽然有这个功能,但目前兼容性较差,如非纯英语系统建议不要启用这个功能,很多软件界面会出错,甚至不能运行,会否导致蓝屏我就不清楚了 |
3
littlewing 337 天前 via iPhone
不想折腾就换 Linux 或 WSL2 试试看
|
4
makerbi 337 天前
如果是 Windows 下长期做开发的话,可以考虑打开全局 utf-8 ,能避免大部分编码问题
![PixPin_2024-01-20_14-37-56.jpg]( https://sapic.makerb.pro/static/upload/andersonby/PixPin_2024-01-20_14-37-56.jpg) |
5
makerbi 337 天前
|
6
iktor OP 太感谢各位大佬了,我先按照你们的方法试一下,如果还有什么问题再请教。谢谢!
|