安装openai-whisper遇Preparing metadata错误:Python版本不兼容
解决Python 3.12安装openai-whisper时的依赖兼容错误
问题根源
执行pip install openai-whisper时出现Preparing metadata (setup.py) ... error、subprocess-exited-with-error报错,核心原因是当前Python版本为3.12.0,而whisper依赖的numba库仅支持>=3.8,<3.12的Python版本,导致元数据生成流程失败。
可行解决方案
方案1:降级Python版本(直接有效)
- 卸载当前Python 3.12.0,安装Python 3.11.x系列版本(如3.11.6)
- 重新执行安装命令:
pip install openai-whisper
方案2:手动安装兼容版numba后再装whisper
- 先安装numba兼容版本(以0.57.1为例,支持Python 3.8-3.11):
pip install numba==0.57.1 - 再安装openai-whisper:
pip install openai-whisper
方案3:用虚拟环境隔离Python版本(推荐,不影响全局环境)
- 基于Python 3.11创建虚拟环境:
python3.11 -m venv whisper-env - 激活虚拟环境:
- Windows系统:
whisper-env\Scripts\activate - Linux/macOS系统:
source whisper-env/bin/activate
- Windows系统:
- 激活环境后执行安装命令:
pip install openai-whisper
内容的提问来源于stack exchange,提问作者mohamed ahmed
相关产品推荐
相关产品推荐

