youtube-dl https://www.youtube.com/watch?v=b2nF9k4_FOo
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/bin/youtube-dl/__main__.py", line 16, in <module>
File "/usr/bin/youtube-dl/youtube_dl/__init__.py", line 15, in <module>
File "/usr/bin/youtube-dl/youtube_dl/options.py", line 8, in <module>
File "/usr/bin/youtube-dl/youtube_dl/downloader/__init__.py", line 3, in <module>
File "/usr/bin/youtube-dl/youtube_dl/downloader/common.py", line 9, in <module>
File "/usr/bin/youtube-dl/youtube_dl/compat.py", line 22, in <module>
ImportError: No module named xml.etree.ElementTree
Python 2 was almost completely removed from Tumbleweed (I believe only basic interpreter remains to satisfy requirements of some major projects). Where does you copy come from? youtube-dl in Tumbleweed is built against Python 3.
zypper if youtube-dl
Loading repository data...
Reading installed packages...
Information for package youtube-dl:
-----------------------------------
Repository : Main Repository (OSS)
Name : youtube-dl
Version : 2020.06.06-1.1
Arch : noarch
Vendor : openSUSE
Installed Size : 1.8 MiB
Installed : Yes (automatically)
Status : up-to-date
Source package : youtube-dl-2020.06.06-1.1.src
Summary : A tool for downloading from video sites for offline watching
Description :
youtube-dl is a small command-line program to retrieve videos from
YouTube.com and other video sites for later watching.
I am not using TW, but Leap 15.1. In my system youtube-nl comes from Packman. Did you do the Vendor switch to Packman as is advised in the sticky threads of the Multi-media sub-forums (better fitting I guess then the Applications sub-forum you choose).
zypper se -i youtube-dl
S | Name | Summary | Type
--+----------------------------+-----------------------------------------------------------------------+--------
i | python3-youtube-dl | A Python module for downloading from video sites for offline watching | package
i | youtube-dl | A tool for downloading from video sites for offline watching | package
i | youtube-dl-bash-completion | Bash completion for youtube-dl | package
erlangen:~ # zypper se -is youtube-dl
Loading repository data...
Reading installed packages...
S | Name | Type | Version | Arch | Repository
---+----------------------------+---------+------------------+--------+-----------
i+ | youtube-dl | package | 2020.06.16.1-1.1 | noarch | packman
i | youtube-dl-bash-completion | package | 2020.06.16.1-1.1 | noarch | packman
erlangen:~ #
Change logs are pretty terse:
* Tue Jun 16 2020 Mathias Homann <Mathias.Homann@opensuse.org>
- Updated to version 2020.06.16.1
* Mon Jun 15 2020 Mathias Homann <Mathias.Homann@opensuse.org>
- Updated to version 2020.06.16
* Fri Jun 05 2020 Mathias Homann <Mathias.Homann@opensuse.org>
- Updated to version 2020.06.06
“As I recall, I may be wrong, but the binary naming conventions for Python is that ‘python’ is for legacy Python 2, if you want to invoke Python 3, you have to explicitly call ‘python3’.
This is how both versions can coexist on one installation. Ino general, Python 2 scripts are not compatible with Python 3.
You may need to install Python 2. As I recall though, it will be deprecated soon, or already has been.”
As far as installing the Tumbleweed version, I only found python38-youtube-dl in that repo and I got the same error about a missing directory.
[FONT=monospace]**erlangen:~ #** zypper install youtube-dl
Loading repository data...
Reading installed packages...
'youtube-dl' is already installed.
No update candidate for 'youtube-dl-2021.02.04.1-1.1.noarch'. The highest available version is already installed.
Resolving package dependencies...
Nothing to do.
**erlangen:~ #**[/FONT]
Evan more so as python38-youtube-dl is Python module and does not install any executable at all. This module does have some files that upstream start with “!/usr/bin/env python” but these lines are removed when package is built.
youtube-dl in Tumbleweed is provided by - gasp - youtube-dl package. That package installs single binary that embeds Python code and it does not invoke “/usr/bin/env python”.
So you apparently continue to use some other version of youtube-dl (Packman?) which was not adjusted and still contains Python2 dependency. That is something to be fixed in Packman. While python2 interpreter may still be present, all needed Python2 modules are likely to have been removed at this point (as the original post shows).
Okay I’ve got it working now. The only youtube-dl I could find that wasn’t from packman was in the Tumbleweed:Factory repo which I didn’t have enabled. Thanks for the help.
Hi
Well technically Factory is Tumbleweed, but is in the oss repo?
zypper if youtube-dl
Information for package youtube-dl:
-----------------------------------
Repository : Main Repository (OSS)
Name : youtube-dl
Version : 2021.01.24.1-1.1