When you mentioned GTK+ >=2.20 was needed, I double checked and found out that 
"ska::pygtk" was giving me the 2.16 version. I recreated the virtual 
environment with "ska::pygtk" swapped out for "jochym::pygtk" which gives GTK+ 
2.24. However, I still get the same error when running the standalone Pygwy 
script. When I used `ldd /lib/x86_64-linux-gnu/libgtkglext-x11-1.0.so.0`,  all 
but two lines of the output were analogous/seemingly correct (I'm well beyond 
my depth on this of course); a shortened version of the output is below:

      linux-vdso.so.1 (0x00007ffcef175000)
      libgdk-x11-2.0.so.0 => /lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0 
(0x000074a8f5305000)
      libgmodule-2.0.so.0 => /lib/x86_64-linux-gnu/libgmodule-2.0.so.0 
(0x000074a8f52fe000)
      [...]
      libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x000074a8f3f42000)
      /lib64/ld-linux-x86-64.so.2 (0x000074a8f53e0000)
      libgraphite2.so.3 => /lib/x86_64-linux-gnu/libgraphite2.so.3 
(0x000074a8f3f1b000)
      [...]
      libmd.so.0 => /lib/x86_64-linux-gnu/libmd.so.0 (0x000074a8f3ddc000)

When I run `LD_PRELOAD=/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 
./runscript.py`, I get the following output:

Gtk-Message: 12:13:12.965: Failed to load module "atk-bridge"
Gtk-Message: 12:13:12.989: Failed to load module "canberra-gtk-module"
(python:945209): GdkPixbuf-WARNING **: 12:13:13.016: Cannot open pixbuf loader 
module file 
'/data/cosmos2/anaconda/envs/_build/etc/gtk-2.0/gdk-pixbuf.loaders': No such 
file or directory
(python:945209): GdkPixbuf-WARNING **: 12:13:13.022: Cannot open pixbuf loader 
module file 
'/data/cosmos2/anaconda/envs/_build/etc/gtk-2.0/gdk-pixbuf.loaders': No such 
file or directory
ImportError: could not import gtk

________________________________
From: David Nečas (Yeti) <[email protected]>
Sent: Friday, October 18, 2024 4:02 AM
To: Gwyddion use discussion <[email protected]>
Subject: Re: [Gwyddion-users] Python error when trying to build from source 
with pygwy support

On Thu, Oct 17, 2024 at 09:34:46PM +0000, Smith, Justin wrote:
> ...and in this case I also have to build the libpng15 from source for the
> virtual environment. After doing that, I can access the Pygwy Console, and I
> can import gwyutils without an immediate error. However, when I try to use gwy
> I have problems. When I try to use the get_min_max() method shown on the 
> Python
> Scripting page of the docs, I get an error ("AttributeError: 'module' object
> has no attribute '__file__'"); when I try to check the file path with
> gwy.__file__ I get an error ("AttributeError: 'module' object has no attribute
> '__file__'"). If I print gwyutils.__file__ the output is 
> '/home/jds/miniconda3/
> envs/gwyd/share/gwyddion/pygwy/gwyutils.py', so that is working despite the
> fact that gwyutils itself imports gwy.

This is usually caused by missing __init__.py, but it is rarely clear
where, i.e. what module the error refers to. Since gwy itself is a
single-file binary module it should not be causing this.

> Traceback (most recent call last):
>   File "runscript.py", line 5, in <module>
>     import gwy
> ImportError: /lib/x86_64-linux-gnu/libgtkglext-x11-1.0.so.0: undefined symbol:
> gtk_widget_get_realized

The function should be defined in /lib/x86_64-linux-gnu/libgtk-x11-2.0…
Gwyddion definitely links with GTK+. The function was introduced in GTK+
2.20 and you cannot have GTK+ older than from 2010.

Something might have been linked wrong, and possibly not Gwyddion
itself.

You can try

    ldd /lib/x86_64-linux-gnu/libgtkglext-x11-1.0.so.0

to see if all the libraries are resolved. You can also try to run the
standalone script with

    LD_PRELOAD=/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 …

but I suspect that the one undefined symbol would be just the tip of an
iceberg.

Regards,

Yeti



_______________________________________________
Gwyddion-users mailing list
[email protected]
https://urldefense.com/v3/__https://lists.sourceforge.net/lists/listinfo/gwyddion-users__;!!LkSTlj0I!E7yt2nC2jej8-5utJc0IriJ54rTytEWydzMoG3v2UWBrcNn-_5Gslu-SP2BVeJUBvlm6N3zNoafgh2d3msSPXA$
_______________________________________________
Gwyddion-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gwyddion-users

Reply via email to