facelessuser / Rummage

Rummage is a GUI for grep like searches in Python
https://facelessuser.github.io/Rummage/
MIT License
74 stars 10 forks source link

Rummage can't find libwebkit2gtk anymore? #447

Closed toxpal closed 11 months ago

toxpal commented 11 months ago

Just made a fresh installation of Linux Manjaro KDE and tried installing rummage as always. Unfortunately, couldn't install it using pip install rummage anymore because of infamous PEP 668 – Marking Python base environments as “externally managed” change. Got it to work by removing EXTERNALLY-MANAGED file as explained in https://stackoverflow.com/questions/75608323/how-do-i-solve-error-externally-managed-environment-everytime-i-use-pip3 and other tutorials.

Installation worked fine as usual, but rummage still doesn't run and displays this error:

notify-send 0.8.2
libwebkit2gtk-4.0.so.37: cannot open shared object file: No such file or directory
Traceback (most recent call last):
  File "/home/toxpal/.local/lib/python3.11/site-packages/rummage/lib/gui/dialogs/rummage_dialog.py", line 40, in <module>
    from ..gui import GUI_PATCHED  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/toxpal/.local/lib/python3.11/site-packages/rummage/lib/gui/gui.py", line 23, in <module>
    import wx.html2
  File "/usr/lib/python3.11/site-packages/wx/html2.py", line 15, in <module>
    from ._html2 import *
ImportError: libwebkit2gtk-4.0.so.37: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/toxpal/.local/bin/rummage", line 5, in <module>
    from rummage.__main__ import main
  File "/home/toxpal/.local/lib/python3.11/site-packages/rummage/__main__.py", line 31, in <module>
    from .lib.gui.app import rummage_app  # noqa: E402
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/toxpal/.local/lib/python3.11/site-packages/rummage/lib/gui/app/rummage_app.py", line 24, in <module>
    from ..dialogs import rummage_dialog
  File "/home/toxpal/.local/lib/python3.11/site-packages/rummage/lib/gui/dialogs/rummage_dialog.py", line 45, in <module>
    raise RuntimeError("GUI has not been patched. Please run tools/gui_patch.py")
RuntimeError: GUI has not been patched. Please run tools/gui_patch.py

I'm pretty sure libwebkit2gtk is installed, here's the screenshot of installed packages matching "gtk" - https://ibb.co/x2H0F6n

Just to be sure, I installed rummage on some older distro (which still allows installing via pip command) and it worked fine. So I'm not sure if the issue is in rummage itself or some breaking change happened recently? Manjaro Linux is actually Arch Linux, which has bleeding-edge software.

P.S. I'm aware of this line in error message - RuntimeError: GUI has not been patched. Please run tools/gui_patch.py - and I'd be happy to run tools/gui_patch.py, except that no such file exists in my system. Any ideas, please?

facelessuser commented 11 months ago

@toxpal

So the patch error is misleading. The interface file is generated from wxFormBuilder, but some of the things that are generated are still not quite right and require me to run a script to ensure the file can be properly imported. If I don't patch the file after it is generated, it will fail to import, so I put that error in to help me catch when I forget to run that patch file.

Unfortunately, if the import fails for any other reason you'll get that message as well. The file is patched, and the error above clearly states the real issue is libwebkit2gtk. So that is the problem, and that must be fixed.

Maybe this article will help? https://itsfoss.com/solve-open-shared-object-file-quick-tip/

Or maybe try to install: libwebkit2gtk-4.0-dev

Linux is always a mess for these kinds of things.

toxpal commented 11 months ago

@facelessuser, thank you for your prompt assistance as always. So webkit2gtk is (and was) installed, but after searching for webkit2gtk packages in repositories I found another, exactly the same package (exactly the same name, version, and even size). Once I installed this duplicated package, rummage started working again.

Once again thanks for your help and very useful tool. Just sent you a small donation, so you can buy yourself some beer or coffee :)

facelessuser commented 11 months ago

Thanks a lot. Glad you could get it resolved. I wish Linux installations were more smooth

but after searching for webkit2gtk packages in repositories I found another, exactly the same package (exactly the same name, version, and even size). Once I installed this duplicated package, rummage started working again.

Yep, that sounds like Linux. It's always some unintuitive fix. Glad you were able to get it up and running again.

Once again thanks for your help and very useful tool. Just sent you a small donation, so you can buy yourself some beer or coffee :)

Thanks a lot, it is much appreciated!