Installing Whisper
You need three things: Python, ffmpeg,
and the openai-whisper package. This
chapter installs them into a virtual
environment — a private folder of
Python packages — so the large
machine-learning library Whisper depends
on does not sprawl across your system.
The instructions are Linux-shaped; the differences on macOS and Windows are called out where they bite.
Step 1: Python and ffmpeg
Whisper needs Python 3.9 or newer (the lab used 3.12) and ffmpeg on the PATH.
python3 --version
ffmpeg -version | head -1
Check: both commands answer with a
version. If ffmpeg is missing, install
it with your package manager —
sudo apt install ffmpeg on Debian and
Ubuntu, brew install ffmpeg on macOS,
or on Windows choco install ffmpeg or
scoop install ffmpeg (those two are
the project's own suggestions).
Step 2: the virtual environment
python3 -m venv ~/whisper-env
source ~/whisper-env/bin/activate
On Windows the activation line is
~\whisper-env\Scripts\activate in
PowerShell. Your prompt changes to show
the environment name; every pip and
whisper command from now on belongs to
it. Type deactivate to leave.
Step 3: PyTorch, the CPU way
Whisper is built on PyTorch, and the ordinary install fetches the full graphics-card edition of it — several gigabytes, most of it libraries for NVIDIA cards you may not have. If your machine has no NVIDIA graphics card, install the CPU edition first, from PyTorch's own index:
pip install torch \
--index-url https://download.pytorch.org/whl/cpu
The lab did this and got torch 2.14.1+cpu — a few hundred megabytes instead of several gigabytes. If you do have an NVIDIA card and want it used, skip this step and let the next one fetch the standard build; this guide was verified on CPU only, and says so wherever speed is discussed.
Step 4: Whisper itself
pip install openai-whisper
whisper --help | head -5
Check: --help prints the usage text
(usage: whisper [-h] [--model MODEL] ...).
The lab's install reported
openai-whisper 20250625. Versions are
dated rather than numbered, and the
project moves; what matters is that the
command answers.
Two traps the project's README warns
about, worth knowing before you meet
them: on some platforms the install
needs a Rust toolchain (if a dependency
called tiktoken has no ready-made wheel
for your machine), and if the install
fails with No module named
'setuptools_rust', installing
setuptools-rust first is the fix.
What you have now
Nothing has been downloaded from OpenAI
yet — the models arrive on first use,
which is chapter 4. The whole install is
one folder (~/whisper-env) plus, soon,
a model cache; deleting both removes
Whisper completely.