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:

9d7cdee68dc58c27b9dc97230217f374b91183ec.png

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


Requirements

Original Project

Regards.,

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 setup.py 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

Regards.,

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

Regards.,

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.

Note

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

rpm -qa python2-wxpython                                                    
python2-wxpython-3.0.2.0-25.fc30.x86_64

If this step does not report version 3.0.2.0 don’t install it for now or contact the project developer on GITHUB → Issues · MrS0m30n3/youtube-dl-gui · 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…

Regards.,

It reports this:

python2-wxpython-3.0.2.0-24.fc29.x86_64

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: Flathub—An app store and build service for Linux

1 Like

it’s could be install youtube-dlg

  [root@postman NAVER]# pip install youtube-dlg
  Collecting youtube-dlg
  Using cached https://files.pythonhosted.org/packages/55/28   /70620c1ffb8ad7ecb81913a053dc454ad7116d3fbdbd8ca23ac0b19ebb40/Youtube-DLG-0.4.tar.gz
  Installing collected packages: youtube-dlg
  Running setup.py 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

@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

Regards.,

2 Likes

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 os.name == "nt"
def windows_setup():
    def normal_setup():
        package_data = {}

        # Add pixmaps icons (*.png) & i18n files
        package_data[__packagename__] = [
            "data\\pixmaps\\*.png",
            "locale\\*\\LC_MESSAGES\\*.mo"
        ]

        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 = [
            "C:\\Windows\\System32\\ffmpeg.exe",
            "C:\\Windows\\System32\\ffprobe.exe",
            "C:\\python27\\DLLs\\MSVCP90.dll"
        ]
            options = {
            "includes": ["wx.lib.pubsub.*",
                         "wx.lib.pubsub.core.*",
                         "wx.lib.pubsub.core.arg1.*"]
        }
        #############################################

        # Add py2exe deps & pixmaps icons (*.png)
        data_files.extend([
            ("", 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, "youtube_dl_gui.mo")

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

        # Add GUI executable details
        windows.append({
            "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()
else:
    params = linux_setup()

see this lines in windows setup:

            "includes": ["wx.lib.pubsub.*",
                         "wx.lib.pubsub.core.*",
                         "wx.lib.pubsub.core.arg1.*"]

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 : → youtube-dl-gui/setup.py at master · MrS0m30n3/youtube-dl-gui · GitHub

Have a nice day…everyone~

NOTE:

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

Regards.,

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: