python and gtk3 and gdk-pixbuf and maybe big sur

Langer, Stephen A. (Fed) stephen.langer at
Wed Jul 14 02:16:30 UTC 2021

On 7/12/21, 9:52 PM, "macports-users on behalf of Langer, Stephen A. (Fed) via macports-users" <macports-users-bounces at<mailto:macports-users-bounces at> on behalf of macports-users at<mailto:macports-users at>> wrote:

On 7/12/21, 8:34 PM, "Ryan Schmidt" <ryandesign at> wrote:

    On Jul 12, 2021, at 10:40, Langer, Stephen A. (Fed) wrote:


    > Hi --


    > Since upgrading to Big Sur and reinstalling all ports, I can't run gtk3 with either python37 or python38.  Running this:


    > % python

    >>>> import gi

    >>>> gi.require_version("Gtk", "3.0")

    >>>> from gi.repository import Gtk


    > Leads to this:


    > ** (process:3291): WARNING **: 11:18:57.866: Failed to load shared library './gdk-pixbuf/libgdk_pixbuf-2.0.0.dylib' referenced by the typelib: dlopen(./gdk-pixbuf/libgdk_pixbuf-2.0.0.dylib, 9): image not found


    > using either python27 or python38.  The gdk-pixbuf2 port is installed.


    > I have two MacPorts installations, one for the default variants and one that uses quartz instead of x11, so both are built from source and use a non-standard installation prefix.  This didn’t cause a problem before the Big Sur upgrade.  Both have the same problem now.


    > Can someone tell me if this problem exists on a normal MacPorts installation?  Am I doing something wrong?  I've tried the fixes suggested in


    > I don't know for sure if the problem is due to the Big Sur upgrade.

    You didn't say whether you were on Intel or Apple Silicon so I downloaded both


    and extracted the contents. In both of those, the files opt/local/share/gir-1.0/GdkPixbuf-2.0.gir and opt/local/share/gir-1.0/GdkPixdata-2.0.gir have the correct (absolute path) library reference:


    which is as I would have expected since gobject-introspection and gdk-pixbuf2 (and atk) were rev-bumped 6 months ago to fix this problem ( Since you use nonstandard MacPorts prefixes you won't have received those archives but will have built from source, but we would expect the result to be comparable.

    Can you show us the output of this command on your system (from

    grep "shared-library" /opt/local/share/gir-1.0/*.gir | grep -v /opt/local/lib

    (replacing both occurrences of /opt/local with whatever your MacPorts prefix is).

Here is the output:

iolanthe 505>> grep "shared-library" /opt/local/stow/ports-quartz/share/gir-1.0/*.gir | grep -v /opt/local/stow/ports-quartz/lib

/opt/local/stow/ports-quartz/share/gir-1.0/AppStreamGlib-1.0.gir:             shared-library="./libappstream-glib/libappstream-glib.8.dylib"

/opt/local/stow/ports-quartz/share/gir-1.0/Atk-1.0.gir:             shared-library="./atk/libatk-1.0.0.dylib"

/opt/local/stow/ports-quartz/share/gir-1.0/Atspi-2.0.gir:             shared-library="./atspi/libatspi.0.dylib"

/opt/local/stow/ports-quartz/share/gir-1.0/Babl-0.1.gir:             shared-library="./babl/libbabl-0.1.0.dylib"

/opt/local/stow/ports-quartz/share/gir-1.0/GDesktopEnums-3.0.gir:             shared-library=""

/opt/local/stow/ports-quartz/share/gir-1.0/GExiv2-0.10.gir:             shared-library="./gexiv2/libgexiv2.2.dylib"

/opt/local/stow/ports-quartz/share/gir-1.0/GdkPixbuf-2.0.gir:             shared-library="./gdk-pixbuf/libgdk_pixbuf-2.0.0.dylib"

/opt/local/stow/ports-quartz/share/gir-1.0/GdkPixdata-2.0.gir:             shared-library="./gdk-pixbuf/libgdk_pixbuf-2.0.0.dylib"

/opt/local/stow/ports-quartz/share/gir-1.0/Gegl-0.4.gir:             shared-library="./gegl/libgegl-0.4.0.dylib"

/opt/local/stow/ports-quartz/share/gir-1.0/GtkSource-4.gir:             shared-library="./gtksourceview/libgtksourceview-4.0.dylib"

/opt/local/stow/ports-quartz/share/gir-1.0/Notify-0.7.gir:             shared-library="./libnotify/libnotify.4.dylib"

/opt/local/stow/ports-quartz/share/gir-1.0/Peas-1.0.gir:             shared-library="./libpeas/libpeas-1.0.0.dylib"

/opt/local/stow/ports-quartz/share/gir-1.0/PeasGtk-1.0.gir:             shared-library="./libpeas-gtk/libpeas-gtk-1.0.0.dylib"

/opt/local/stow/ports-quartz/share/gir-1.0/Soup-2.4.gir:             shared-library="./libsoup/libsoup-2.4.1.dylib"

/opt/local/stow/ports-quartz/share/gir-1.0/SoupGNOME-2.4.gir:             shared-library="./libsoup/libsoup-gnome-2.4.1.dylib"

I should have said I'm on Intel.

To be more specific about what I'm doing, the two installation prefixes are /opt/local/stow/ports-quartz and /opt/local/stow/ports/-x11.  When building macports, I also use --with-applications-dir=/Applications/stow/ports-quartz or --with-applications-dir=/Applications/stow/ports-x11.  To switch from one to the other, I have a script that unstows one and stows the other (using the stow port).  The only place where that's not practical is for startup items, so I add "startupitem_install no" to macports.conf in the quartz directory.

Thanks again.

-- Steve

More info:

I moved my non-standard installations aside (unstowed them) and installed MacPorts 2.7.1 from the pkg file, with no customizations.   Then I installed the gdk-pixbuf2, gobject-introspection, and py38-pygobject3 ports and their dependencies from source (with "port -s install …").   After that /opt/local/share/gir-1.0/GkdPixbuf-2.0.gir and /opt/local/share/gir-1.0/GdkPixdata-2.0.gir both contain relative paths for shared-library.

Uninstalling gdk-pixbuf2 and reinstalling without -s leads to .gir files with absolute paths.

I'll file a bug report but I don't know if this is a gdk-pixbuf2 bug or a gobject-introspection bug.

-- Steve

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the macports-users mailing list