FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg' means Python found no ffmpeg on its PATH. Install it, use the binary in imageio-ffmpeg, or post the job to ReelSDK at $0.02 per compute minute.
FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg'
We reproduced it on Python 3.13 with ffmpeg off PATH: subprocess failed before ffmpeg printed a line. ReelSDK ran the same 720x1280 scale in about 8 seconds with no binary; imageio-ffmpeg's bundled one took about 12.
ErrorsUpdated
Traceback (most recent call last):
File "/home/user/app/convert.py", line 3, in <module>
subprocess.run(["ffmpeg", "-y", "-i", "in.mp4", "-vf", "scale=720:-2", "out.mp4"], check=True)
File "/usr/local/lib/python3.13/subprocess.py", line 554, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/local/lib/python3.13/subprocess.py", line 1039, in __init__
File "/usr/local/lib/python3.13/subprocess.py", line 1991, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg'Source: Python subprocess docs, checked November 2026.
Where it shows up
The moment Python tries to start ffmpeg
Your code starts ffmpeg by name, and the Python process has no ffmpeg on its PATH. We ran subprocess.run(["ffmpeg", ...], check=True) on Python 3.13 with ffmpeg off PATH and got FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg' from _execute_child in subprocess.py, before ffmpeg could print a line.
Wrappers fail the same way, because they start the same binary. ffmpeg-python raised the identical error. pydub first warns Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work, then fails on ffprobe, which it calls first to read the file. On Windows, Python names the same failure [WinError 2] The system cannot find the file specified; we ran Linux only.
Why it happens
Errno 2 means no program by that name on PATH
subprocess asks the operating system to start a program called ffmpeg, and the OS looks for it in each directory on the PATH of the Python process. Errno 2 is ENOENT: no file by that name in any of them. Your arguments and input are not the problem; ffmpeg never started.
Your shell and your app can have different PATHs. A service, a scheduled job or a container can start Python without the directory your ffmpeg lives in, or on a machine where it was never installed. shutil.which("ffmpeg") shows what Python sees: None with ffmpeg off PATH, /usr/bin/ffmpeg with it.
Causes and fixes
Where ffmpeg goes missing in Python, and the fix
| Setup | What you see | Fix |
|---|---|---|
| subprocess.run with ffmpeg off PATH | FileNotFoundError: [Errno 2] ... 'ffmpeg' | Install ffmpeg, or pass a full path |
| ffmpeg-python | The same FileNotFoundError | Install ffmpeg |
| pydub | A RuntimeWarning, then FileNotFoundError for ffprobe | Install ffmpeg with ffprobe |
| pydub on Python 3.13 | ModuleNotFoundError: No module named 'pyaudioop' | pip install audioop-lts |
| pip install ffmpeg | Still not found: no binary inside | Uninstall it, use a real install |
| No system packages allowed | Nothing to install with | imageio-ffmpeg, or the API |
Source: Python subprocess docs, checked November 2026.
The local fix
Install ffmpeg, or let pip bring a binary
Check from inside the failing process first, then install ffmpeg where that process runs. On Debian or Ubuntu that is apt-get install ffmpeg, which on Debian 13 brings ffmpeg 7.1. Note that pip install ffmpeg does not help: it installs an unrelated Python package named ffmpeg, with no binary inside.
If you can't install system packages, pip install imageio-ffmpeg brings one file: a recent ffmpeg build with libx264, about 173 MB. With its path in place of "ffmpeg", our script scaled an 11-second clip in about 12 seconds, still with no ffmpeg on PATH. It has no ffprobe, so pydub still needs a full install.
import shutil
print(shutil.which("ffmpeg"))
# None: this Python process cannot see ffmpeg
# /usr/bin/ffmpeg: it can# Debian or Ubuntu: ffmpeg and ffprobe
apt-get update && apt-get install -y ffmpeg
# or a pip-installed ffmpeg binary, no system package needed
pip install imageio-ffmpeg==0.8.1import subprocess
import time
import imageio_ffmpeg
ffmpeg = imageio_ffmpeg.get_ffmpeg_exe()
print(ffmpeg)
started = time.perf_counter()
subprocess.run([ffmpeg, "-y", "-i", "clip.mp4", "-vf", "scale=720:-2", "out.mp4"], check=True, capture_output=True)
print(f"done in {(time.perf_counter() - started) * 1000:.0f} ms")Skip the binary
Or call ffmpeg over HTTP
POST /v1/ffmpeg runs ffmpeg 8.1 on a fresh machine per job, so your Python process only needs an HTTP client. The same scale came back as a 720x1280 out.mp4 about 8 seconds after the request.
Compute is $0.02 per minute, billed per second, so that job cost well under a cent. From Python, post the same JSON body with any HTTP client and read the links in job.outputs.
curl "https://api.reelsdk.com/v1/ffmpeg?wait=60" \
-H "Authorization: Bearer $REELSDK_KEY" \
--json '{
"inputs": {
"in.mp4": "https://api.reelsdk.com/f/lib/demo/clip.mp4"
},
"args": ["-y", "-i", "in.mp4", "-vf", "scale=720:-2", "out.mp4"],
"outputs": ["out.mp4"]
}'pydub on Python 3.13
Python 3.13 removed 19 legacy modules, audioop among them, and pydub imports audioop at startup. On Python 3.13 it fails with ModuleNotFoundError: No module named 'pyaudioop' before it even looks for ffmpeg. pip install audioop-lts brings the module back; after that you get the ffmpeg and ffprobe errors above until both are installed.
FAQ
Questions, answered
Why does ffmpeg work in my terminal but not in Python?
The Python process has a different PATH from your shell. Print shutil.which("ffmpeg") from inside the failing code: None means Python can't see it. Install ffmpeg where the code runs, or pass the full path from which ffmpeg in your shell.
Does pip install ffmpeg fix it?
No. That installs an unrelated Python package named ffmpeg, with no binary inside, and shutil.which still returned None for us. pip install imageio-ffmpeg does bring a binary, which you call through get_ffmpeg_exe().
Is the imageio-ffmpeg binary enough for production?
For ffmpeg itself, yes: it ships a recent ffmpeg build with libx264, about 173 MB. It has no ffprobe, so tools that need ffprobe, such as pydub, still need a full install.
What does the error look like on Windows?
FileNotFoundError: [WinError 2] The system cannot find the file specified, which is Windows' text for error 2. We ran Linux only; the cause and the fixes are the same.
- Error: spawn ffmpeg ENOENTNode cannot find an ffmpeg program on PATH. Install it, spawn the ffmpeg-static path, or send the same args to an API.
- Unknown encoder 'libx264'Your ffmpeg build has no x264 inside. Use libopenh264, install a GPL build, or send the same args to an API that has libx264.
- ffmpeg exited with code 1: Conversion failed!fluent-ffmpeg reports only ffmpeg's exit code and last line. The real cause is in stderr: print it, or use -v error to see it alone.
- ReelSDK vs self-hosted FFmpegTranscoding a minute of 1080p to 720p takes about 24 seconds of compute: about 0.8 cents on ReelSDK, about a tenth of a cent on a busy 4 vCPU box. Below about 11,000 minutes a month, the API costs less than an always-on box.
- Resize videoRender 9:16, 1:1, 4:5 and 16:9 copies of one video in a single ffmpeg call, about 2 cents for all 4 from a 30 s clip.
- Resize a video with ffmpegScale a video with scale=w:h: keep the aspect ratio with -2, fit a 1080x1920 frame with pad, and fix the odd-size error.
- FFmpeg onlineRun your own ffmpeg command on your files in the browser, free and without installing or uploading anything.
Ready to build?
Ship video from your app today
Your first $0.50 is free, and one key covers every endpoint.
