Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation Procedure Results in Non-Functional youtube-dl #27253

Closed
4 of 6 tasks
doeWalker opened this issue Nov 29, 2020 · 10 comments
Closed
4 of 6 tasks

Installation Procedure Results in Non-Functional youtube-dl #27253

doeWalker opened this issue Nov 29, 2020 · 10 comments

Comments

@doeWalker
Copy link

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.11.29
  • 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

$ sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
[sudo] password for walker: 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     3    0     0    0     0      0      0 --:--:--  0:00:06 --:--:--     0
  0     3    0     0    0     0      0      0 --:--:--  0:00:13 --:--:--     0
100   632  100   632    0     0     46      0  0:00:13  0:00:13 --:--:--    46
100 1737k  100 1737k    0     0   116k      0  0:00:14  0:00:14 --:--:-- 2063k
$ ls -l /usr/local/bin | grep youtube
-rw-r--r-- 1 root root 1779048 Nov 29 14:51 youtube-dl
$ sudo chmod a+rx /usr/local/bin/youtube-dl
$ ls -l /usr/local/bin | grep youtube
-rwxr-xr-x 1 root root 1779048 Nov 29 14:51 youtube-dl
$ which youtube-dl
/usr/local/bin/youtube-dl
$ youtube-dl --version
/usr/bin/env: ‘python’: No such file or directory
$ 
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.1 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

Description

The installation procedures provided here do not yield an operational version of youtube-dl. As shown above, after the d/l, attempting to check the version yields an error:

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

Perhaps this has something to do with how Ubuntu locates its Python files, or perhaps there is an error in youtube-dl. I have not tried this only on the system identified above: VERSION="20.04.1 LTS (Focal Fossa)"

@absolutelynothelix
Copy link

do you have python installed at all?

@doeWalker
Copy link
Author

doeWalker commented Nov 29, 2020

@mighty9245

I did not install Python separately. I installed Ubuntu 20.04 ~ 3 weeks ago. I assumed it had Python installed (I think this is default). I have checked it just now:

$ which python
$ which python3
/usr/bin/python3

Perhaps this is the problem? Python 2 is not installed as default - Python 3 is ??? Is this an Ubuntu issue, or is this a youtube-dl issue? I don't know... I'm reporting here as there is no mention in the install instructions to check any Python is installed.

@absolutelynothelix
Copy link

absolutelynothelix commented Nov 29, 2020

i guess this is rather an issue of your system than an issue of youtube-dl. you have to set default python version. a simple and most obvious way of doing this for me is symlinking /usr/bin/python to /usr/bin/python3, but since you are using ubuntu there is update-alternatives , so you probably need to use it instead like this.

@doeWalker
Copy link
Author

doeWalker commented Nov 29, 2020

@mighty9245 :

What does that do... by that I mean does it actually install something new (Python2) on my system? If Python2 is not installed on my system (and it's not) - how does this work?

@absolutelynothelix
Copy link

absolutelynothelix commented Nov 29, 2020

it just sets python3 as default python version. for example, you may have both python2 and python3 installed, and instead of calling python3 most of the time and rarely python2, you can set python3 as default python version and call it via just python and call python2 explicitly when needed. having python3 installed should be enough for youtube-dl, but you have to set is as default python version.

@doeWalker
Copy link
Author

@mighty9245

I don't want to install Python2 just so I can use the update-alternatives solution... is that what's required? That's a long way around, don't you think?

@absolutelynothelix
Copy link

absolutelynothelix commented Nov 29, 2020

you don't have to install python2, you have to set python3 as default python version. actually, this should be done by default and i have no idea why you have python3 installed but don't have it set as default python version.

just do sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10 and that's it, youtube-dl should work.

@doeWalker
Copy link
Author

doeWalker commented Nov 29, 2020

@mighty9245

Not to shirk responsibility (I do know it's my system after all), but again: I installed nothing - Python3 came as a part of the default installation:

From the Focal Fossa Release Notes:

Python3 by default

In 20.04 LTS, the python included in the base system is Python 3.8. Python 2.7 has been moved to universe and is not included by default in any new installs.

Remaining packages in Ubuntu which require Python 2.7 have been updated to use /usr/bin/python2 as their interpreter, and /usr/bin/python is not present by default on any new installs. etc, etc

And thanks for your clarification and patience. I'll try this as soon as I finish another experiment I'm running, and post my results here.

RESULT:

This works! :)

@CoolCat64
Copy link

CoolCat64 commented Nov 30, 2020

Description

The installation procedures provided here do not yield an operational version of youtube-dl. As shown above, after the d/l, attempting to check the version yields an error:

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

Perhaps this has something to do with how Ubuntu locates its Python files, or perhaps there is an error in youtube-dl. I have not tried this only on the system identified above: VERSION="20.04.1 LTS (Focal Fossa)"

I recently had this very same issue on an Ubuntu 20.04 install in WSL 2. Same exact error.

I found a package, python-is-python3, which you can download from the Ubuntu repository "http://archive.ubuntu.com/ubuntu focal/main amd64 Packages". But this package just creates a symlink, exactly what mighty9245 posted. Unfortunately, the package detail description states, "No packages may declare dependencies on this package." I am guessing this is because the package may break older software requiring python2.

I just installed the package on both my Ubuntu20.04 install and kali-linux install, but now I know I could have just manually created a symlink myself. This seems like a much bigger issue than youtube-dl. I am sure many other packages have similar problems if they want to be compatible with both python3 and older systems with python2 installed.

@remitamine
Copy link
Collaborator

python binary/symlink has to be accessible in your system PATH, this is not a youtube-dl problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants