安装Python库Omnizart时遭遇Build Wheel错误求助
安装Omnizart库时遭遇
Getting requirements to build wheel ... error问题 我在安装Omnizart库时反复碰到Getting requirements to build wheel ... error错误。已经单独执行pip install ffmpeg fluidsynth pysoundfile安装了依赖,也多次安装Cython,但还是提示ModuleNotFoundError: No module named 'Cython',尝试用虚拟环境也解决不了。完整错误日志如下:
Getting requirements to build wheel ... error error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [20 lines of output] Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module> main() File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\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 "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\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\vihaa\AppData\Local\Temp\pip-build-env-prt9nxta\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\vihaa\AppData\Local\Temp\pip-build-env-prt9nxta\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires self.run_setup() File "C:\Users\vihaa\AppData\Local\Temp\pip-build-env-prt9nxta\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup super().run_setup(setup_script=setup_script) File "C:\Users\vihaa\AppData\Local\Temp\pip-build-env-prt9nxta\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup exec(code, locals()) File "<string>", line 12, in <module> ModuleNotFoundError: No module named 'Cython' [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 wheel did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip.
可行的解决办法
- 强制在安装Omnizart前确保Cython已安装,执行以下命令:
pip install cython && pip install omnizart - 检查pip环境一致性:确认安装Cython和Omnizart用的是同一个pip。Windows下用
where pip,Linux/macOS用which pip查看路径,同时用pip --version确认版本,避免系统pip和虚拟环境pip混淆。 - 升级核心工具后再安装:
pip install --upgrade pip setuptools wheel cython pip install omnizart - 虚拟环境下操作:激活虚拟环境后,先装Cython再装Omnizart,以Windows虚拟环境为例:
venv\Scripts\activate pip install cython pip install omnizart - 源码安装:克隆仓库后手动安装Cython再执行本地安装:
git clone https://github.com/Music-and-Culture-Technology-Lab/omnizart.git cd omnizart pip install cython pip install -e .
内容的提问来源于stack exchange,提问作者Vihaan
相关产品推荐
相关产品推荐

