Skip to main content
Topic: GIMP: gimpfu breaks because of pygtk and Cairo (Read 350 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

GIMP: gimpfu breaks because of pygtk and Cairo

Hello.

Gimp is very useful because it has many plugins, and recently, Resynthesizer that replaces image parts was broken.
I saw similar issues raised in Arch previously, and I am unsure if reporting it is useful, but at the very least, I couldn't solve it myself yet.

For context, this is a log I see if I update Artix today, build a fresh Resynthesizer out of Git, install it and try to use the "heal selection" function.

Code: [Select]
Traceback (most recent call last):
  File "/usr/lib/gimp/2.0/python/gimpfu.py", line 853, in _run
    res = _interact(proc_name, params[1:])
  File "/usr/lib/gimp/2.0/python/gimpfu.py", line 372, in _interact
    import gimpui
  File "/usr/lib/gimp/2.0/python/gimpui.py", line 33, in <module>
    import gtk, gobject, gimp, gimpcolor
  File "/usr/lib/python2.7/site-packages/gtk-2.0/gtk/__init__.py", line 40, in <module>
    from gtk import _gtk
  File "/usr/lib/python2.7/site-packages/cairo/__init__.py", line 1, in <module>
    from ._cairo import *  # noqa: F401,F403
ImportError: /usr/lib/python2.7/site-packages/cairo/_cairo.so: undefined symbol: cairo_tee_surface_index

Since it's about Gimpfu requiring PyGTK and Cairo, I expect the same issue to apply to many similar plugins.

Does anyone know a fix?

Re: GIMP: gimpfu breaks because of pygtk and Cairo

Reply #1
I wouldn't say a fix but a quick search on 'undefined symbol: cairo_tee_surface_index' suggests using an older version of pycairo. The following post is only a few days old.
Quote
It looks like it got broken with pycairo 1.23

Please install pycairo 1.22
https://stackoverflow.com/questions/48049253/python-import-cairo-error-2-7-3-6-undefined-symbol-cairo-tee-surface-inde

Regarding Resynthesizer I just read an issue on their github saying on Arch try to use gimp-git(AUR) as that is apparently not reliant on python 2 any more. However I've no idea if that's good advice.

Re: GIMP: gimpfu breaks because of pygtk and Cairo

Reply #2
I've tried to downgrade using those packages, but there are no changes, and it feels like those barely contain anything.

Code: [Select]
doas pacman -U --noconfirm python2-cairo-1.18.2-4-x86_64.pkg.tar.zst
doas pacman -U --noconfirm python-cairo-1.22.0-1-x86_64.pkg.tar.zst

Thanks for the gimp-git advice; I'm going to try it.

Re: GIMP: gimpfu breaks because of pygtk and Cairo

Reply #3
Update: I've installed Gimp-GIT as well, installing gimp-plugin-resynthesizer after. No luck there, Gimp-GIT works, and Resynthesizer doesn't appear in the menu.

 

Re: GIMP: gimpfu breaks because of pygtk and Cairo

Reply #4
This plugin apparently uses python2 according to the backtrace. That's most likely your issue. If anything, I'm surprised it took this long to break.