On 8/2/23 21:18, Masaru Nomiya wrote:
Hello,
In the Message;
Subject : Re: youtube download problems Message-ID :<CAHeBFz1-X4U46+B0evnZ_MiXF2yWyXYO8vVWnuPysYHwT=B2hQ@mail.gmail.com> Date & Time: Wed, 2 Aug 2023 20:31:15 -0700
[CS] == Carl Spitzer<lynuxrocks@gmail.com> has written:
[...] CS> sudo yt-dlp -U CS> [sudo] password for root: CS> Latest version: 2023.07.06, Current version: 2023.01.06 CS> Current Build Hash CS> 3d47785962f7b07d38ab6465d4e4e827bd014805e727b71ecc6f1f56606663b2 CS> Updating to version 2023.07.06 ... CS> Updated yt-dlp to version 2023.07.06 cwsiv@localhost:~> yt-dlphttps://www.youtube.com/watch?v=6GcdY5wtpso CS> Traceback (most recent call last): CS> File "/usr/bin/yt-dlp/yt_dlp/__init__.py", line 2, in <module>
CS> ModuleNotFoundError: No module named 'contextvars'
CS> During handling of the above exception, another exception occurred:
CS> Traceback (most recent call last): CS> File "/usr/lib64/python3.6/runpy.py", line 193, in _run_module_as_main CS> "__main__", mod_spec) CS> File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code CS> exec(code, run_globals) CS> File "/usr/bin/yt-dlp/__main__.py", line 14, in <module> CS> File "<frozen importlib._bootstrap>", line 971, in _find_and_load CS> File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked CS> File "<frozen importlib._bootstrap>", line 656, in _load_unlocked CS> File "<frozen importlib._bootstrap>", line 626, in CS> _load_backward_compatible CS> File "/usr/bin/yt-dlp/yt_dlp/__init__.py", line 5, in <module>
CS> Exception: You are using an unsupported version of Python. Only Python CS> versions 3.7 and above are supported by yt-dlp
The module named 'contextvars' was added since python 3.7.
So, you need python3.7 or later to use yt-dlp.
The solution to this problem is not difficult; simply install python 3.7 or higher (you will also be asked to install some files, but you can accept them all) and run as root like this;
# update-alternatives --config python3
then choose the python3 you have installed.
It makes me nervous to do it that way. I installed Anaconda instead which gives me: Python 3.11.3, and it doesn't touch Leap's python. Just two days ago one of my users (who has root) tried to load an updated python and failed miserably. He wound up removing lots of system dependencies and borked his system. We were able to figure out what he deleted from his zypper log and ran it backwards to restore his system. We need to reconsider his having root! Regards. Lew