I have a simple PyGObject application:
from gi.repository import Gtk class Window(Gtk.Window): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.set_border_width(5) self.button = Gtk.Button('Test') self.box = Gtk.Box() self.box.pack_start(self.button, True, True, 0) self.add(self.box) self.connect('delete-event', Gtk.main_quit) self.show_all() win = Window() Gtk.main()
I am trying to freeze it with cx_freeze on Linux using the following setup.py script:
from cx_Freeze import setup, Executable setup(name="GUI Test", description="GUITest", version="0.1", options={"build_exe": {"build_exe": "Bin/pygobject", "create_shared_zip": False, }}, executables=[Executable(script="hello_pygobject.py", targetName="hello", appendScriptToExe=True, )] )
And I run it like this: python3 setup_pygobject.py build
When I try to start a frozen application, I get the following error message:
(process:22538): Gtk-CRITICAL **: gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed Segmentation fault (core dumped)
I probably miss a bunch of libraries in the directory, such as they explained for Windows . I tried pmap find the missing libraries. As a last resort, I also tried to copy all the libraries in /usr/lib64/ (+ some others that I donβt remember) into the working directory.
Is there a good way to find the libraries I need, or is there a better way to fix them?
A related question, but for Windows: Python3 + PyGobject + GTK3 and cx_freeze are missing DLLs
EDIT:
I tried using dbg to examine the core dump. I got it:
... Core was generated by `./hello'. Program terminated with signal SIGSEGV, Segmentation fault.
When I installed the individual debuginfos, I got the following:
... Core was generated by `./hello'. Program terminated with signal SIGSEGV, Segmentation fault.
When running the application through gdb I got the following:
... (process:21699): Gtk-CRITICAL **: gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed Program received signal SIGSEGV, Segmentation fault. _gtk_settings_get_style_cascade (settings=0x0, scale=scale@entry =1) at gtksettings.c:1764 1764 GtkSettingsPrivate *priv = settings->priv;
Stack trace:
(gdb) backtrace
EDIT 2:
Matching packages:
python3.x86_64 3.4.2-6.fc22 python3-gobject.x86_64 3.16.2-1.fc22 cx-Freeze (4.3.4)