Msys2上带有pygobject的Pyinstaller

问题描述 投票:3回答:1

我一直在使用python pygobject在Linux上构建应用程序,现在我需要在Windows上分发它。

我首先通过msys2安装了pygobject(根据官方pygobject文档)

现在,使用msys2 / mingw32,我可以输入以下内容运行程序:>

python3 main.py

但是当我尝试使用Pyinstaller将其冻结为.exe并尝试运行生成的.exe时

  • 如果我不使用--onefile,则会在_struct模块上收到导入错误(而“ import _struct”在python shell中有效)]]

  • 如果使用--onefile,则会出现以下错误:

  • 错误:

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

我使用的是Pyinstaller的精简版。我在Windows操作系统上几乎一无所知...有人知道如何解决该错误吗?

我一直在使用python pygobject在Linux上构建应用程序,现在我需要在Windows上分发它。我首先通过msys2安装了pygobject(根据官方pygobject文档)...

python pyinstaller pygtk pygobject msys2
1个回答
0
投票

听起来您走在正确的道路上,很遗憾,您遇到了PyInstaller中的错误。好消息是No module named '_struct'错误的问题现在为fixed,并在3.6版及更高版本中发布。我建议使用PyInstaller的--onedir模式,您应该能够成功为Windows打包GTK应用程序。

© www.soinside.com 2019 - 2024. All rights reserved.