我使用 PyInstaller 为我的 python2.7 包构建了一个 mac os x 应用程序包。双击应用程序图标会立即弹出控制台窗口,但会立即消失。但是,双击展开的“Contents/MacOS/executable”会正确弹出预期的窗口。
以下是我扩展的应用程序内容的屏幕截图。 Frameworks 文件夹是空的,Resources 文件夹包含图标,MacOS 文件夹包含所有二进制库和可执行文件(如上所述运行正常)。不确定修改 info.plist 是否有帮助。
最佳答案
您是否尝试过使用 -w
标志?来自文档:
-w, --windowed, --noconsole
Use a windowed subsystem executable, which on Windows does not open the console when the program is launched. This option is mandatory when creating .app bundle on Mac OS X.
关于python - 从 pyinstaller 构建的 mac os x 应用程序包无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18328703/