[CentOS] youtube-dl No module named 'pkg_resources'

Wed May 8 20:04:37 UTC 2019
Marko Vojinovic <vvmarko at gmail.com>

On Wed, 8 May 2019 09:08:12 -0500 (CDT)
Michael Hennebry <hennebry at web.cs.ndsu.nodak.edu> wrote:

> On Wed, 8 May 2019, Nux! wrote:
> > How did you install it?
> Most recently
> yum reinstall youtube-dl
> > I'm using their binary and it works great, just tested it.
> >
> > https://ytdl-org.github.io/youtube-dl/download.html

So am I. Despite generally favoring regular repositories, in the
particular case of youtube-dl I prefer to uninstall the repo version,
and follow the instructions on their website above. I just do a wget and
a chmod as explained there, and it downloads itself into /usr/local/bin.
Whenever it fails to work, usually a simple

  sudo youtube-dl -U

will update itself to the latest version, which does work.

The errors you encounter are typically not a problem in the script
itself, nor in python, but a change in the structure of the youtube.com
html code. It gets changed often, and then the older youtube-dl fails to
parse the new youtube.com code structure, and errors out. But usually
there is an updated version (often the same day) of youtube-dl, which
parses the new html code correctly.

If you use the repo version of youtube-dl, it may take a couple of
weeks even for the update to land. On the other hand, the above manual
update works immediately, with no hassle.

Never failed me so far.

HTH, :-)