Problem with yt-dlp's dependencies [SOLVED]

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

Post Reply
User avatar
Makoto
Posts: 76
Joined: Thu Jul 16, 2020 6:29 am
Has thanked: 10 times
Been thanked: 8 times

Problem with yt-dlp's dependencies [SOLVED]

Post 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:

Last edited by Makoto on Sat Oct 16, 2021 10:28 pm, edited 2 times in total.

[ FossaPup64 9.5, Frugal install ]

williams2
Posts: 1062
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 305 times

Re: Using yt-dlp

Post 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.

User avatar
Makoto
Posts: 76
Joined: Thu Jul 16, 2020 6:29 am
Has thanked: 10 times
Been thanked: 8 times

Re: Using yt-dlp

Post 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

[ FossaPup64 9.5, Frugal install ]

williams2
Posts: 1062
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 305 times

Re: Using yt-dlp

Post 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.

User avatar
Makoto
Posts: 76
Joined: Thu Jul 16, 2020 6:29 am
Has thanked: 10 times
Been thanked: 8 times

Re: Using yt-dlp

Post 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?

[ FossaPup64 9.5, Frugal install ]

User avatar
fredx181
Posts: 3059
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 373 times
Been thanked: 1300 times
Contact:

Re: Using yt-dlp

Post 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.

williams2
Posts: 1062
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 305 times

Re: Using yt-dlp

Post 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/

User avatar
fredx181
Posts: 3059
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 373 times
Been thanked: 1300 times
Contact:

Re: Using yt-dlp

Post 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

User avatar
Makoto
Posts: 76
Joined: Thu Jul 16, 2020 6:29 am
Has thanked: 10 times
Been thanked: 8 times

Re: Using yt-dlp

Post 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. :|

[ FossaPup64 9.5, Frugal install ]

User avatar
fredx181
Posts: 3059
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 373 times
Been thanked: 1300 times
Contact:

Re: Using yt-dlp

Post by fredx181 »

Did you first update the packages lists ?

User avatar
Makoto
Posts: 76
Joined: Thu Jul 16, 2020 6:29 am
Has thanked: 10 times
Been thanked: 8 times

Re: Problem with yt-dlp's dependencies

Post 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:

[ FossaPup64 9.5, Frugal install ]

User avatar
fredx181
Posts: 3059
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 373 times
Been thanked: 1300 times
Contact:

Re: Problem with yt-dlp's dependencies

Post 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 856 times
User avatar
Makoto
Posts: 76
Joined: Thu Jul 16, 2020 6:29 am
Has thanked: 10 times
Been thanked: 8 times

Re: Problem with yt-dlp's dependencies

Post 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!

[ FossaPup64 9.5, Frugal install ]

Post Reply

Return to “Users”