/usr/bin/env: ‘python’: No such file or directory
Author: yoonesCreated Oct 19, 2021Updated Aug 19, 2026
Labelsdocumentationnot-a-buglinux
Checklist
- I'm reporting a broken site support issue
- I've verified that I'm running youtube-dl version 2021.06.06
- I've checked that all provided URLs are alive and playable in a browser
- I've checked that all URLs and arguments with special characters are properly quoted or escaped
- I've searched the bugtracker for similar bug reports including closed ones
- I've read bugs section in FAQ
Verbose log
yoones:~$ whereis youtube-dl
youtube-dl: /usr/local/bin/youtube-dl
yoones:~$ youtube-dl
/usr/bin/env: ‘python’: No such file or directory
Description
OS: Debian 11.1
I have the following binaries installed:
- python2.7
- python3
- python3.9
The shebang of youtube-dl (#!/usr/bin/env python) does not work in this context since there is no executable file called python.
Suggested solution:
Have a shell script that acts as a launcher. This script could for instance embed a list of known python interpreters (python, python2.7, python3, ...) and use the first of the list that is present on the host.
Source: ytdl-org/youtube-dl