youtube-dl /usr/bin/env: ‘python’: No such file or directory

In Ubuntu 20.04, python3 is the installed default. The python variable is not set:

❯ which python
python not found

We can get around this by using python3 and which:

❯ python3 $(which youtube-dl) https://www.youtube.com/watch?v=0IE-CXNs6Sw
[youtube] 0IE-CXNs6Sw: Downloading webpage

I think python is missing on your system so,

First of all check if you have python installed . To check this simply open terminal and type python. If it shows python version and prompt then quit by typing quit()

And if python is missing then install it with this command :

sudo apt-get install python3

If that does not help, then try this command:

sudo update-alternatives --install  /usr/bin/python python /usr/bin/python3 1000

I had the exact same problem trying to install youtube-dl in ubuntu 20.04 and spent a long time trying to resolve. On the verge of giving up, I saw this from Canonical and thought it looks too simple but tried it anyway! Problem solved!

sudo snap install youtube-dl