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 Gwyddion-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gwyddion-users