Page 1 of 1

Problem with yt-dlp's dependencies [SOLVED]

Posted: Thu Oct 14, 2021 10:21 pm
by Makoto

(BionicPup 64 8.0, with the devx installed)

I'm trying to test yt-dlp, which is a fork of youtube-dl, but apparently more actively developed, and when I run it, this is the result:

Code: Select all

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "./yt-dlp/__main__.py", line 16, in <module>
  File "./yt-dlp/yt_dlp/__init__.py", line 16, in <module>
  File "./yt-dlp/yt_dlp/options.py", line 15, in <module>
  File "./yt-dlp/yt_dlp/utils.py", line 33, in <module>
  File "/usr/lib/python3.6/ssl.py", line 101, in <module>
    import _ssl             # if we can't import it, let the error propagate
ImportError: /lib64/libssl.so.1.1: version `OPENSSL_1_1_1' not found (required by /usr/lib/python3.6/lib-dynload/_ssl.cpython-36m-x86_64-linux-gnu.so)

So, in theory, would I need to update Python, SSL/libssl, or both? :oops:


Re: Using yt-dlp

Posted: Thu Oct 14, 2021 11:31 pm
by williams2

I think you need to install python3. Easiest way seems to be to compile the source.

Bionicpup64 seems to have openssl 1.1.0 installed, which might need to be updated to work with python3.

Code: Select all

# openssl version
OpenSSL 3.0.0 7 sep 2021 (Library: OpenSSL 3.0.0 7 sep 2021)
# openssl1 version
OpenSSL 1.1.0g  2 Nov 2017
# python --version
Python 2.7.15rc1
#

I installed OpenSSL 3.0.0 7 from a package by @rockedge

And there may be other dependencies.
https://github.com/yt-dlp/yt-dlp#dependencies

It might not be easy to get yt-dip running in Bionicpup.


Re: Using yt-dlp

Posted: Fri Oct 15, 2021 12:20 am
by Makoto

I've been running youtube-dl with no problems... you'd think the list of dependencies wouldn't have changed that much. :D

PPM seems to think I have python3 installed to some extent, even though python --version returns the same result you had above.
Image


Re: Using yt-dlp

Posted: Fri Oct 15, 2021 3:03 am
by williams2

I think the easiest way to install python3 is
to download the source from https://www.python.org/downloads/source/

See: viewtopic.php?p=31804#p31804

You need to set up correct symlinks:

Code: Select all

cd /usr/local/bin/
ln -fs python3.9 python3
ln -fs python3.9 python
ln -fs pip3.9 pip3
ln -fs pip3.9 pip

cd /usr/bin/
rm -f python
# uncomment the next line if you want python to be python2
# ln -fs python2.7 python
#
# 
# ll /usr/bin/python* /usr/local/bin/python* /usr/local/bin/pip*
lrwxrwxrwx 1    9 Mar 31  2017 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 3.6M Feb 25  2019 /usr/bin/python2.7
lrwxrwxrwx 1    6 Oct 14 22:46 /usr/local/bin/pip -> pip3.9
lrwxrwxrwx 1    6 Oct 14 22:46 /usr/local/bin/pip3 -> pip3.9
-rwxr-xr-x 1  229 May 29 23:55 /usr/local/bin/pip3.9
lrwxrwxrwx 1    9 Oct 14 22:46 /usr/local/bin/python -> python3.9
lrwxrwxrwx 1    9 Oct 14 22:46 /usr/local/bin/python3 -> python3.9
-rwxr-xr-x 1 3.9M May 30 00:01 /usr/local/bin/python3.9
-rwxr-xr-x 1 3.1K May 29 23:55 /usr/local/bin/python3.9-config
#
# python --version
Python 3.9.5
#

In BionicPip64, youtube-dl seems to run well using python3.


Re: Using yt-dlp

Posted: Fri Oct 15, 2021 6:49 am
by Makoto

Nah, easier would be a Python3 SFS, as I'm not sure I'm using all that much that requires Python other than youtube-dl. :) But, I'll give it a try when I can find a bit more time, this weekend. (...I hope.)

What does the

Code: Select all

cd /usr/bin/
rm -f python

section of that script do? Does the compile and install set up a temp directory in /usr/bin even with the altinstall command?


Re: Using yt-dlp

Posted: Fri Oct 15, 2021 9:50 am
by fredx181

@Makoto

Try re-installing libssl1.1 (probably it will be upgraded then, if not you may need to update the package lists first and try again)
Initially I got the same libssl error as you, but reinstalling fixed it.


Re: Using yt-dlp

Posted: Fri Oct 15, 2021 4:47 pm
by williams2

cd /usr/bin/
rm -f python

In BionicPup64, the python2.7 executables are located in /usr/bin/
/usr/bin/python is a symlink to /usr/bin/python2.7

If you download the python3 source and compile it using the default configuration, the python3 executables will be put in /usr/local/bin/

The shell (bash) searches /usr/bin/ for executables first, then if it doesn't find them, it will then search /usr/local/bin/

if /usr/bin/python is a symlink to /usr/bin.python2.7
and if /usr/local/bin/python is a symlink to /usr/local/bin/python3.9
then typing python --version will display this:

Code: Select all

# python --version
Python 2.7.15rc1
#

If you set up the symlinks correctly, python will execute python2.7 or python3.9, whichever you choose.

If you want, you can move all the python executables to /usr/bin/

If you want, you can configure the python source to compile to /usr/bin/


Re: Using yt-dlp

Posted: Fri Oct 15, 2021 6:00 pm
by fredx181

I'd say there's no need to compile python3 from source, I got yt-dlp working, by simply installing python3 from PPM (and upgrade libssl1.1) on BionicPup64.
Also, note that yt-dlp doesn't depend on python3 symlinked correctly to "python", it's using /usr/bin/python3 by default, as first line shows opening yt-dlp with text-editor :
#!/usr/bin/env python3


Re: Using yt-dlp

Posted: Fri Oct 15, 2021 8:18 pm
by Makoto

I tried updating OpenSSL to 1.1.1 through PPM, since PPM seems to believe I already have some sort of Python3 setup (above). yt-dlp still returns the same error messages. :|


Re: Using yt-dlp

Posted: Fri Oct 15, 2021 8:48 pm
by fredx181

Did you first update the packages lists ?


Re: Problem with yt-dlp's dependencies

Posted: Fri Oct 15, 2021 9:42 pm
by Makoto

No, but that's partly because I thought I'd done that sometime recently. I did that, then uninstalled the version of OpenSSL I'd installed through PPM and installed the version of OpenSSL 1.1.1 it gave me...
no apparent change.

Code: Select all

root# ./yt-dlp
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "./yt-dlp/__main__.py", line 16, in <module>
  File "./yt-dlp/yt_dlp/__init__.py", line 16, in <module>
  File "./yt-dlp/yt_dlp/options.py", line 15, in <module>
  File "./yt-dlp/yt_dlp/utils.py", line 33, in <module>
  File "/usr/lib/python3.6/ssl.py", line 101, in <module>
    import _ssl             # if we can't import it, let the error propagate
ImportError: /lib64/libssl.so.1.1: version `OPENSSL_1_1_1' not found (required by /usr/lib/python3.6/lib-dynload/_ssl.cpython-36m-x86_64-linux-gnu.so)

@williams2
Forgot to reply - ah, okay. I should've thought there was a possibility it might be a symlink. :oops:


Re: Problem with yt-dlp's dependencies

Posted: Sat Oct 16, 2021 7:45 am
by fredx181
Makoto wrote:

uninstalled the version of OpenSSL I'd installed through PPM and installed the version of OpenSSL 1.1.1 it gave me...

For me, upgrading package "libssl1.1" fixed the problem, not OpenSSL 1.1.

Screenshot.png
Screenshot.png (155.91 KiB) Viewed 850 times

Re: Problem with yt-dlp's dependencies

Posted: Sat Oct 16, 2021 10:28 pm
by Makoto

I was hoping the 'main package' included libssl. :D (I know, I know, wishful thinking.)

But it did seem to fix the problem.

Code: Select all

root# ./yt-dlp
Usage: yt-dlp [OPTIONS] URL [URL...]

yt-dlp: error: You must provide at least one URL.
Type yt-dlp --help to see a list of all options.

Thanks!