diffuse icon indicating copy to clipboard operation
diffuse copied to clipboard

gi not found on Mac

Open BeastyBlacksmith opened this issue 3 years ago • 8 comments

After running the install.py script of version 0.5 on MacOS running diffuse gives:

Traceback (most recent call last):
  File "/usr/local/bin/diffuse", line 120, in <module>
    import gi
ModuleNotFoundError: No module named 'gi'

BeastyBlacksmith avatar Aug 12 '20 10:08 BeastyBlacksmith

You need the PyGObject python package.

From Stackoverflow, it seems that this command should work (with Homebrew):

brew install pygobject3

MightyCreak avatar Aug 12 '20 21:08 MightyCreak

That gives me a GUI window with the following error message

Fehler bei der Analyse der Zeilen 5 von /etc/diffuserc

BeastyBlacksmith avatar Aug 13 '20 08:08 BeastyBlacksmith

Hmm... that's a problem with OS X. @dscherger has this bug as well, you can find his fix here: https://github.com/MightyCreak/diffuse/pull/24/files/6b091a205b0e7f8a6b1e84c70f02f75517e4465a#diff-26c7ae75b933d602876ed212cfc3da9b

I couldn't merge it because it would have broken other platforms. That said, I'm hopeful that the future Meson installation system (PR #61) will fix this bug.

MightyCreak avatar Aug 13 '20 17:08 MightyCreak

@BeastyBlacksmith I have merge PR #61 and now Meson is the only way to install Diffuse on your computer. Could you give it a try?

To install Meson with Homebrew:

brew install meson

The install procedure is explained in the README.

MightyCreak avatar Aug 13 '20 19:08 MightyCreak

There was the also the gtk-update-icon-cache missing, so I installed gtk-mac-integration and it built. Running diffuse gives now:

Traceback (most recent call last):
  File "/usr/local/bin/diffuse", line 8361, in <module>
    diff = Diffuse(rc_dir)
  File "/usr/local/bin/diffuse", line 7416, in __init__
    p0 = default_theme.load_icon_for_scale("document-new", icon_size, scale_factor, 0)
gi.repository.GLib.Error: gtk-icon-theme-error-quark: Symbol »document-new« nicht im Thema Adwaita vorhanden (0)

BeastyBlacksmith avatar Aug 14 '20 07:08 BeastyBlacksmith

Arf... I knew this day would come... document-new is in the "legacy" directory here on Linux GNOME. Technically it is deprecated, but not obsolete yet as you can see in GNOME documentation, it is still listed in the icon list. But it is also the reason for the warnings at startup (when Diffuse runs well) (issue #55).

This is actually what led me to the Meson build system, so I would be able to use the proper GNOME-way of using resources and the built-in feature in Meson to build them (as seen here: https://gitlab.gnome.org/World/Authenticator/-/blob/master/data/meson.build#L19)

Well, know that I'm working on it! I can't give you an ETA, but knowing that it has become a problem on OSX, it raised its priority.

MightyCreak avatar Aug 14 '20 14:08 MightyCreak

Yeah, I can confirm brew install pygobject3 works.

chenrui333 avatar Mar 06 '22 21:03 chenrui333

This issue can be closed now that we have better support for macOS.

hugoholgersson avatar Apr 06 '23 14:04 hugoholgersson