How to install faster-whisper [guide]

这个“How to install faster-whisper [guide]”讨论的是在 Python 3.13 上安装 faster-whisper 时因 ctranslate2 缺少对应 wheel 而失败,优先改用 Python 3.12 的独立虚拟环境安装。

快速结论:这个“How to install faster-whisper [guide]”讨论的是在 Python 3.13 上安装 faster-whisper 时因 ctranslate2 缺少对应 wheel 而失败,优先改用 Python 3.12 的独立虚拟环境安装。

适用环境:Issue 已确认的环境线索是 Python 3.13 缺少 ctranslate2 的 wheel、且没有源码分发包;建议使用 Python 3.12。Issue 未提供操作系统、CUDA、PyTorch、显卡具体版本。

最快修复方案:使用 uv 创建 Python 3.12 虚拟环境,然后在该虚拟环境里执行 uv pip install faster-whisper。

注意事项:faster-whisper 只安装在当前虚拟环境中,需要通过 deactivate 和 source .venv/bin/activate 切换;不要把 Python 3.12 降级方案当作全局安装。Issue 中提到的 uvx 方式未成功,提示包不提供可执行文件。

问题场景

用户希望在项目中使用 Faster Whisper,但在 Python 3.13 环境下安装时受阻。Issue 正文明确指出 ctranslate2 没有 Python 3.13 的 wheel,也没有提供 source dist,因此直接安装无法完成。

报错原文

How to install faster-whisper [guide]

ctranslate2 doesn't have wheels for Python 3.13 nor provides a source dist

The executable `faster-whisper` was not found.
warning: Package `faster-whisper` does not provide any executables.

原因分析

可能原因是当前 Python 版本为 3.13,而 faster-whisper 依赖的 ctranslate2 尚未提供 Python 3.13 可用的 wheel,也没有源码分发包,导致安装链路无法继续。Issue 给出的可行方向是改用 Python 3.12。

另一个需要区分的问题是:faster-whisper 是 Python 库,不是提供 faster-whisper 可执行命令的工具。因此使用 uvx 直接运行时会提示找不到可执行文件,这并不代表安装一定失败。

环境排查

  • 确认当前 Python 版本,重点检查是否为 Python 3.13。
  • 确认是否使用虚拟环境,避免与系统或其他项目依赖冲突。
  • 确认是否安装了 uv,并可用于创建指定 Python 版本的虚拟环境。
  • 确认安装的是 faster-whisper Python 包,而不是期望它提供命令行可执行文件。
  • Issue 未提供 CUDA、PyTorch、显卡及操作系统版本,这些项目无法从当前讨论中确认。

解决步骤

  1. 安装 uv。Issue 正文链接了 uv 的安装文档,可先完成 uv 安装。
  2. 进入你希望使用 faster-whisper 的项目目录。
  3. 执行 uv venv --python 3.12,创建 Python 3.12 虚拟环境。
  4. 激活该虚拟环境。
  5. 执行 uv pip install faster-whisper,在当前虚拟环境中安装 faster-whisper。
  6. 安装完成后,在同一个虚拟环境中使用 faster-whisper。需要退出时执行 deactivate,再次进入时执行 source .venv/bin/activate。
  7. 如果你尝试过 uvx --python 3.12 --prerelease=allow faster-whisper,注意 Issue 中该方式并未成功,会提示 The executable `faster-whisper` was not found. 和 warning: Package `faster-whisper` does not provide any executables.,因此不要把它当作已验证的一步修复方案。

验证方法

在已完成安装的 Python 3.12 虚拟环境中导入 faster-whisper。如果导入成功且没有出现 ctranslate2 与 Python 3.13 不兼容的安装错误,说明问题已解决。Issue 没有给出具体的导入命令或测试音频,因此这里不补写未经验证的命令。

参考来源

SYSTRAN/faster-whisper #1240

GamsGo AI

AI 工具推荐

想把多个 AI 模型放在一个入口?

GamsGo AI 集成 ChatGPT、DeepSeek、Gemini、Claude、Midjourney、Veo 等常用模型,适合写作、绘图、视频和日常 AI 工作流。

了解 GamsGo AI

推广链接:通过此链接购买,我可能获得佣金,不影响你的价格。

这个方案解决了吗?

celebrityanime
celebrityanime
文章: 26975

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注