楼主你好,使用msys2 python3 下的 pyinstaller打包时 出现了问题向你请教一下(使用背景是想在windows下开发GTK3 应用):
1)安装gtk官网步骤安装,没有问题;
2)因为想使用pyinstaller, 因此先安装了pip3 pacman -S mingw-w64-x86_64-python3-pip, 然后pip3 installer pyinstaller;
3)测试 pyinstaller 能否可用, 因此运行 pyinstaller --onedir main.py 打包
其中:main.py为 {
import tkinter
top = tkinter.Tk()
top.mainloop()
}
但运行时发生错误,
miracles-@DESKTOP-E9IKCIS MINGW64 ~/code
$ ./dist/main/main.exe
[11124] mod is NULL - structTraceback (most recent call last):
File "D:/msys64/mingw64/lib/python3.7/struct.py", line 13, in <module>
from _struct import *
ModuleNotFoundError: No module named '_struct'
[11124] mod is NULL - pyimod02_archiveTraceback (most recent call last):
File "D:/msys64/mingw64/lib/python3.7/site-packages/PyInstaller/loader/pyimod02_archive.py", line 28, in <module>
import struct
ModuleNotFoundError: No module named 'struct'
[11124] mod is NULL - pyimod03_importersTraceback (most recent call last):
File "D:/msys64/mingw64/lib/python3.7/site-packages/PyInstaller/loader/pyimod03_importers.py", line 24, in <module>
from pyimod02_archive import ArchiveReadError, ZlibArchiveReader
ModuleNotFoundError: No module named 'pyimod02_archive'
Traceback (most recent call last):
File "site-packages/PyInstaller/loader/pyiboot01_bootstrap.py", line 15, in <module>
ModuleNotFoundError: No module named 'pyimod03_importers'
[11124] Failed to execute script pyiboot01_bootstrap
请问解决方法,谢谢