我使用 Ubuntu 22.04、pyinstaller 5.0.1、python 3.10.4 和 wxPython 4.1.2a1。
我的软件运行良好。
但我无法构建分发包,即使我使用“隐藏导入”。我没有任何构建错误,但是根本没有生成各种库,并且我的软件无法运行。
我认为这与我无法运行“--windowed”选项有关,因为错误消息:
redge@redge-VirtualBox:~/Developpement/GestConsoPhoenix4.1.x--1.3.9$ source env4.1.x-py310/bin/activate
(env4.1.x-py310) redge@redge-VirtualBox:~/Developpement/GestConsoPhoenix4.1.x--1.3.9$ pyinstaller -w --distpath ./Dist myprogram.spec
686 INFO: PyInstaller: 5.0.1
686 INFO: Python: 3.10.4
687 INFO: Platform: Linux-5.15.0-27-generic-x86_64-with-glibc2.35
option(s) not allowed:
--console/--nowindowed/--windowed/--noconsole
makespec options not valid when a .spec file is given
(env4.1.x-py310) redge@redge-VirtualBox:~/Developpement/GestConsoPhoenix4.1.x--1.3.9$
但是如果没有 windowed 选项,pyinstaller 不会正确生成:没有生成库(wxPython、matplotlib 和其他类似 reportlab/openpyxl/xlsxwriter 的库都没有)。
我使用的各种程序是否存在某种不兼容或其他原因?
感谢您的阅读和任何帮助。
回答1
新的 pyinstaller 5.1 版本解决了问题 :)