3

I have been building an application on Linux using python pygobject, and now I need to distribute it on Windows.

I first installed pygobject via msys2 (as per the official pygobject documentation)

Now, using msys2/mingw32, I can run my program typing

python3 main.py

But when I try to freeze it into a .exe with Pyinstaller, and try to run the produced .exe

  • If I Don't use --onefile, I get an import error on the _struct module (whereas "import _struct" works in python shell)

  • If I use --onefile, I get the Following error :

error:

 lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-ani.dll could not be extracted!
 fopen: No such file or directory  

I’m using the devel version of Pyinstaller. I know next to nothing on Windows OS… does anyone know how to fix that error ?

tbrugere
  • 755
  • 7
  • 17

1 Answers1

2

It sounds like you were on the right path, unfortunately you ran in to a bug in PyInstaller. The good news is that the issue with the No module named '_struct' error is now fixed and released in version 3.6 and later. I would recommend using the --onedir mode of PyInstaller, you should be able to successfully package a GTK app for Windows.

Dan Yeaw
  • 741
  • 8
  • 16
  • Unfortunately, I don’t have access to that codebase anymore so I cannot test your answer, but thank you for answering ! – tbrugere May 02 '20 at 17:05