pip install openai-whisper报错
方案稳定性推荐度使用 Python 3.9/3.10 环境✅ 稳定⭐⭐⭐⭐⭐从 GitHub 安装 whisper⚠️ 可能绕过构建问题⭐⭐⭐升级/降级 setuptools 尝试⚠️ 不一定成功⭐⭐。
·
✅ 解决方法
方法一:降级 Python(推荐使用 Python 3.9~3.10)
Whisper 目前对最新的 Python 3.13 支持还不太完善,建议使用 Python 3.9 或 3.10。你可以使用 pyenv(Linux/Mac)或 pyenv-win、conda、venv 来创建一个干净环境。
# 推荐使用 Python 3.10 创建虚拟环境
python3.10 -m venv whisper-env
source whisper-env/bin/activate # Windows: whisper-env\Scripts\activate
pip install --upgrade pip setuptools wheel
pip install openai-whisper
方法二:直接使用 Git 安装(绕过 PyPI 源)
如果你非要在当前环境下用,也可以试试从 GitHub 安装:
pip install git+https://github.com/openai/whisper.git
不过在 Python 3.13 下不保证不会出别的问题。
方法三:确认你的 pip 和 setuptools 是最新版
pip install --upgrade pip setuptools wheel
然后再尝试安装:
pip install openai-whisper
方法四:降级 setuptools(尝试性方案)
如果你仍然要在当前环境中测试,可以尝试手动降级 setuptools:
pip install setuptools==65.5.1
然后重新安装:
pip install openai-whisper
离线安装(可行但稍麻烦)
你可以从别的能上 GitHub 的电脑或服务器上下载 whisper 项目打包 zip,然后手动安装:
-
点击绿色的 Code -> Download ZIP
-
解压后进入文件夹,执行:
-
pip install .
或者使用 whisper 的依赖安装文件:
pip install -r requirements.txt
pip install .
总结建议
| 方案 | 稳定性 | 推荐度 |
|---|---|---|
| 使用 Python 3.9/3.10 环境 | ✅ 稳定 | ⭐⭐⭐⭐⭐ |
| 从 GitHub 安装 whisper | ⚠️ 可能绕过构建问题 | ⭐⭐⭐ |
| 升级/降级 setuptools 尝试 | ⚠️ 不一定成功 | ⭐⭐ |
更多推荐
所有评论(0)