On 2023-08-03 06: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-dlp https://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.
Telcontar:/etc/systemd/system # ls /usr/bin/python* /usr/bin/python /usr/bin/python2 /usr/bin/python2.7 /usr/bin/python3 /usr/bin/python3.10 /usr/bin/python3.6-config /usr/bin/python3.6m-config /usr/bin/python-config /usr/bin/python2-config /usr/bin/python2.7-config /usr/bin/python3-config /usr/bin/python3.6 /usr/bin/python3.6m /usr/bin/pythontex Telcontar:/etc/systemd/system # So, python 3.10 is installed. How to tell yt-dlp to use that one, even if others are installed? Maybe Telcontar:~ # /usr/bin/python3.10 /usr/bin/yt-dlp --version 2023.06.22 Telcontar:~ # But I have not tried to ask for update itself.
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.
Telcontar:/etc/systemd/system # update-alternatives --config python3 update-alternatives: error: no alternatives for python3 Telcontar:/etc/systemd/system # update-alternatives --config python update-alternatives: error: no alternatives for python Telcontar:/etc/systemd/system # But I'd hesitate to change the setting globally. -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)