Celeb Glow
general | March 28, 2026

Python’: No such file or directory

Youtube-dl is months out of date in the repos so I installed it using this method

(though I changed the location to usr/bin/youtube-dl as that's what which youtube-dl showed)

but then I get

$ youtube-dl
/usr/bin/env: ‘python’: No such file or directory
$ python2 youtube-dl
python2: can't open file 'youtube-dl': [Errno 2] No such file or directory

But it works if I enter

$ python2 /usr/bin/youtube-dl
Usage: youtube-dl [OPTIONS] URL [URL...]
$ python3 /usr/bin/youtube-dl
Usage: youtube-dl [OPTIONS] URL [URL...]

I'm using Xubuntu 20.04, could someone tell me how to fix this?

1 Answer

Starting with 20.04 /usr/bin/python is no longer there. And youtube-dl starts with:

#!/usr/bin/env python

So what you can do is create the symbolic link yourself:

sudo ln -s /usr/bin/python3 /usr/bin/python

And then it should work:

$ youtube-dl
5

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy