Error message while trying to install "youtube-dlg"

According to youtube-dlG GitHub website, when I run this command pip install youtube-dlg the application should be installed, instead I’m getting this error message:


Something about a module named wx.

Any help?

1 Like

This error indicates that your Python application is GUI-based, relying on a missing Python module called wxPython. wxPython is a Python extension module for the wxWidgets GUI library, popularly used by C++ programmers to design GUI applications. The wxPython extension allows Python developers to easily design and integrate GUI within any Python application.

Install PyPi

  1. Run pip install --user youtube-dlg

To solve this import error, you need to install wxPython on your Linux, as described below.

Install wxPython on Fedora

sudo dnf install python2-wxpython

Install another requirement:

Simple two way ordered dictionary for Python

pip install --user twodict


Original Project


1 Like

Also, you should be running pip3 install youtube-dlg, or you’ll end up with the Python 2 version. Bare, versionless Python commands/utils have not yet been switched over to Python 3 by default.

Hello, I followed your and @ferdnyc suggestions but when I attempt to install it using:

pip install youtube-dlg or pip3 install youtube-dlg I get this error message:

Command “python egg_info” failed with error code 1 in /tmp/pip-install-yw7jkb6i/youtube-dlg/

@delacosta78 this project is not porting to python3 yet, just follow my guide I installed it sucessfull


1 Like

That’s what I’m saying, I did everything you suggest but I’m getting that error message.

Did you follow this procedure:

sudo dnf install wxPython
pip install --user twodict
pip install --user youtube-dlg


Yes and this is the whole error message I get:

REALLY!?! Wow, how’s that working out for them? My mistake, then, sorry about that.

In that case, you should really be running pip2 install youtube-dlg, so you know you’ll get the Python 2 version. :wink: (Unversioned Python commands are still the devil.)

Nothing, still the same error message…

Expected, the pip version isn’t about the error message. @hhlp posted information on installing the necessary dependencies.


Your issue is still invalid (for many reasons) i just made an attempt here to help you.

rpm -qa python2-wxpython                                                    

If this step does not report version don’t install it for now or contact the project developer on GITHUB ->

NOTE : The principal problem here is wx.lib.sub has been decapreted

as suggestion in this type of error is better copy and paste from terminal the output and not just an screenshot…


It reports this:


I’m not going to upgrade but near the EOL, so I’ll share anything new when that time comes, thank you for your help anyway.

How about using youtube-dl instead? Much easier and safer than tinkering around with manual installation of phyton modules using pip.

Also, did you notice that there are flatpaks available that do the same?

This one is using youtube-dl as backend:

1 Like

it’s could be install youtube-dlg

  [root@postman NAVER]# pip install youtube-dlg
  Collecting youtube-dlg
  Using cached   /70620c1ffb8ad7ecb81913a053dc454ad7116d3fbdbd8ca23ac0b19ebb40/Youtube-DLG-0.4.tar.gz
  Installing collected packages: youtube-dlg
  Running install for youtube-dlg ... done
  Successfully installed youtube-dlg-0.4

I think that @hhlp is a good example for run and install, so it’s a need to dnf install something.
Have a nice day…everyone~

by simmon


Today I’ve tried to reproduce his problem in a fresh :fedora: 29 clean install, he has some python packages that interfere with youtube-dlg instalation



I am going to dedicate only to analyze the source code of the installation by part:

def on_windows():
    """Returns True if OS is Windows."""
    return == "nt"
def windows_setup():
    def normal_setup():
        package_data = {}

        # Add pixmaps icons (*.png) & i18n files
        package_data[__packagename__] = [

        setup_params = {
            "package_data": package_data

        return setup_params

    def py2exe_setup():
        windows = []
        data_files = []

        # py2exe dependencies & options
        # TODO change directory for ffmpeg.exe & ffprobe.exe
        dependencies = [
            options = {
            "includes": ["wx.lib.pubsub.*",

        # Add py2exe deps & pixmaps icons (*.png)
            ("", dependencies),
            ("data\\pixmaps", glob.glob("youtube_dl_gui\\data\\pixmaps\\*.png")),

        # We have to manually add the translation files since py2exe cant do it
        for lang in os.listdir("youtube_dl_gui\\locale"):
            dst = os.path.join("locale", lang, "LC_MESSAGES")
            src = os.path.join("youtube_dl_gui", dst, "")

            data_files.append((dst, [src]))

        # Add GUI executable details
            "script": "build\\_scripts\\youtube-dl-gui",
            "icon_resources": [(0, "youtube_dl_gui\\data\\pixmaps\\youtube-dl-gui.ico")]

        setup_params = {
            "windows": windows,
            "data_files": data_files,
            "options": {"py2exe": options}

        return setup_params

    if PY2EXE:
        return py2exe_setup()

    return normal_setup()
def linux_setup():
see lines 197-233
if on_windows():
    params = windows_setup()
    params = linux_setup()

see this lines in windows setup:

            "includes": ["wx.lib.pubsub.*",

In linux setup don’t have mention to pubsub at all…

See the Error that @delacosta78 screenshot mention:

py:25 -> wx.lib.pubsub has been deprecated, please migrate your code to use pysubsub, available on PyPi.

Source : ->

Have a nice day…everyone~


Install pypubsub via pip or desintall pubsub via pip too doesn’t help at all


1 Like

Yes, I tried the only two options available so far, one app didn’t work and the other one didn’t extracted the audio in multichannel format as youtube-dlg does, for those who didn’t know, YouTube supports multichannel audio, please read the description of this YouTube video: