Jump to content


mp107

Member Since 28 Aug 2017
Offline Last Active 04 Feb 2024 22:28
-----

Topics I've Started

Installing yt-dlp on OpenPLi 9.0 - is there any way?

27 January 2024 - 13:39

Hi,
I'm working on making work the yt-dlp and liveproxy on OpenPLi 9.0 based image to make it possible to put yt-dlp based channel list entries directly on the channel list (as an alternative to the OpenATV's YTDLPWrapper plugin). I've noticed that on the official image repository there is no yt-dlp package so I decided to try out installing it through pip (pip3) but it didn't work.

In short: Is there any way to install yt-dlp on OpenPLi 9.0?

After fresh install of OpenPLi's developer build (as well as on 9.0) I've run these commands to install liveproxy and yt-dlp...

root@sf8008:~# pip3 install --upgrade liveproxy                                                                                                                       
Collecting liveproxy                                                                                                                                                   
  Downloading liveproxy-2.0.0-py3-none-any.whl (8.5 kB)                                                                                                                
Installing collected packages: liveproxy                                                                                                                               
Successfully installed liveproxy-2.0.0                                                                                                                                 
root@sf8008:~# pip3 install --upgrade yt-dlp                                                                                                                           
Collecting yt-dlp                                                                                                                                                      
  Downloading yt_dlp-2023.12.30-py2.py3-none-any.whl (3.0 MB)
     |████████████████████████████████| 3.0 MB 1.4 MB/s
Collecting urllib3<3,>=1.26.17
  Downloading urllib3-2.1.0-py3-none-any.whl (104 kB)
     |████████████████████████████████| 104 kB 6.6 MB/s
Collecting certifi
  Downloading certifi-2023.11.17-py3-none-any.whl (162 kB)
     |████████████████████████████████| 162 kB 1.2 MB/s
Collecting requests<3,>=2.31.0
  Downloading requests-2.31.0-py3-none-any.whl (62 kB)
     |████████████████████████████████| 62 kB 443 kB/s
Collecting websockets>=12.0
  Downloading websockets-12.0-py3-none-any.whl (118 kB)
     |████████████████████████████████| 118 kB 996 kB/s
Collecting pycryptodomex
  Downloading pycryptodomex-3.20.0.tar.gz (4.8 MB)
     |████████████████████████████████| 4.8 MB 1.5 MB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
ERROR: Exception:
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 186, in _main
status = self.run(options, args)
File "/usr/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 331, in run
resolver.resolve(requirement_set)
File "/usr/lib/python3.9/site-packages/pip/_internal/legacy_resolve.py", line 177, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "/usr/lib/python3.9/site-packages/pip/_internal/legacy_resolve.py", line 333, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/lib/python3.9/site-packages/pip/_internal/legacy_resolve.py", line 282, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File "/usr/lib/python3.9/site-packages/pip/_internal/operations/prepare.py", line 515, in prepare_linked_requirement
abstract_dist = _get_prepared_distribution(
File "/usr/lib/python3.9/site-packages/pip/_internal/operations/prepare.py", line 95, in _get_prepared_distribution
abstract_dist.prepare_distribution_metadata(finder, build_isolation)
File "/usr/lib/python3.9/site-packages/pip/_internal/distributions/sdist.py", line 38, in prepare_distribution_metadata
self._setup_isolation(finder)
File "/usr/lib/python3.9/site-packages/pip/_internal/distributions/sdist.py", line 96, in _setup_isolation
reqs = backend.get_requires_for_build_wheel()
File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/wrappers.py", line 151, in get_requires_for_build_wheel
return self._call_hook('get_requires_for_build_wheel', {
File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/wrappers.py", line 255, in _call_hook
raise BackendUnavailable(data.get('traceback', ''))
pip._vendor.pep517.wrappers.BackendUnavailable: Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 63, in _build_backend
obj = import_module(mod_path)
File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed

File "/var/volatile/tmp/pip-build-env-3ekm2j_v/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 16, in <module>
from .dist import Distribution
File "/var/volatile/tmp/pip-build-env-3ekm2j_v/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 27, in <module>
from .extern.packaging.markers import InvalidMarker, Marker
File "/var/volatile/tmp/pip-build-env-3ekm2j_v/overlay/lib/python3.9/site-packages/setuptools/_vendor/packaging/markers.py", line 11, in <module>
from ._parser import (
File "/var/volatile/tmp/pip-build-env-3ekm2j_v/overlay/lib/python3.9/site-packages/setuptools/_vendor/packaging/_parser.py", line 10, in <module>
from ._tokenizer import DEFAULT_RULES, Tokenizer
File "/var/volatile/tmp/pip-build-env-3ekm2j_v/overlay/lib/python3.9/site-packages/setuptools/_vendor/packaging/_tokenizer.py", line 3, in <module>
from dataclasses import dataclass
ModuleNotFoundError: No module named 'dataclasses'[/code]
... and stuck on the "ModuleNotFoundError: No module named 'dataclasses'" error.

After running that code in the Python's console I've made sure it is not included/installed...

root@sf8008:~# python3
Python 3.9.9 (main, May 22 2023, 19:10:24)
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from dataclasses import dataclass
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'dataclasses'
>>> exit()
root@sf8008:~#

As far as I know that package should be included in Python > 3.6. But either way I've tried to install it manually and check if it is being detected in Python...

root@sf8008:~# pip3 install dataclasses
Collecting dataclasses
Downloading dataclasses-0.6-py3-none-any.whl (14 kB)
Installing collected packages: dataclasses
Successfully installed dataclasses-0.6
root@sf8008:~# python3
Python 3.9.9 (main, May 22 2023, 19:10:24)
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from dataclasses import dataclass
>>> exit()
root@sf8008:~#

After that I've tried to install the yt-dlp once again but still got the same error...

root@sf8008:~# pip3 install --upgrade yt-dlp
Collecting yt-dlp
Using cached yt_dlp-2023.12.30-py2.py3-none-any.whl (3.0 MB)
Collecting websockets>=12.0
Using cached websockets-12.0-py3-none-any.whl (118 kB)
Collecting brotli; implementation_name == "cpython"
Downloading Brotli-1.1.0.tar.gz (7.4 MB)
|████████████████████████████████| 7.4 MB 416 kB/s
Installing build dependencies ... done
Getting requirements to build wheel ... done
ERROR: Exception:
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 186, in _main
status = self.run(options, args)
File "/usr/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 331, in run
resolver.resolve(requirement_set)
File "/usr/lib/python3.9/site-packages/pip/_internal/legacy_resolve.py", line 177, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "/usr/lib/python3.9/site-packages/pip/_internal/legacy_resolve.py", line 333, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/usr/lib/python3.9/site-packages/pip/_internal/legacy_resolve.py", line 282, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File "/usr/lib/python3.9/site-packages/pip/_internal/operations/prepare.py", line 515, in prepare_linked_requirement
abstract_dist = _get_prepared_distribution(
File "/usr/lib/python3.9/site-packages/pip/_internal/operations/prepare.py", line 95, in _get_prepared_distribution
File "/usr/lib/python3.9/site-packages/pip/_internal/distributions/sdist.py", line 38, in prepare_distribution_metadata
self._setup_isolation(finder)
File "/usr/lib/python3.9/site-packages/pip/_internal/distributions/sdist.py", line 96, in _setup_isolation
reqs = backend.get_requires_for_build_wheel()
File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/wrappers.py", line 151, in get_requires_for_build_wheel
return self._call_hook('get_requires_for_build_wheel', {
File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/wrappers.py", line 255, in _call_hook
raise BackendUnavailable(data.get('traceback', ''))
pip._vendor.pep517.wrappers.BackendUnavailable: Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 63, in _build_backend
obj = import_module(mod_path)
File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/var/volatile/tmp/pip-build-env-uzk9l8b4/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 16, in <module>
from .dist import Distribution
File "/var/volatile/tmp/pip-build-env-uzk9l8b4/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 27, in <module>
from .extern.packaging.markers import InvalidMarker, Marker
File "/var/volatile/tmp/pip-build-env-uzk9l8b4/overlay/lib/python3.9/site-packages/setuptools/_vendor/packaging/markers.py", line 11, in <module>
from ._parser import (
File "/var/volatile/tmp/pip-build-env-uzk9l8b4/overlay/lib/python3.9/site-packages/setuptools/_vendor/packaging/_parser.py", line 10, in <module>
from ._tokenizer import DEFAULT_RULES, Tokenizer
File "/var/volatile/tmp/pip-build-env-uzk9l8b4/overlay/lib/python3.9/site-packages/setuptools/_vendor/packaging/_tokenizer.py", line 3, in <module>
from dataclasses import dataclass
ModuleNotFoundError: No module named 'dataclasses'

Is there any way to install the yt-dlp on OpenPLi 9.0 image?