【发布时间】:2021-02-27 04:02:31
【问题描述】:
这是一个常见问题,尽管解决方案似乎多种多样,但没有一个对我有帮助。
就像这个question 和这个question,在mac 上,我的PyInstaller .app 在Finder 中单击时无法打开。但是,从终端 ./helloWorldTest.app/Contents/MacOS/helloWorldTest. 启动时它确实有效。在 Finder 中单击 .exe 文件时它确实有效(从我的阅读来看,这似乎很常见)。
与链接问题中的应用不同,我的应用不读取或写入任何文件:我已将我的实际应用(具有相同的问题行为)完全删除为一个简单的hello world 版本:
# This is a trivial app with a loop to ensure it stays open long enough to actually see something happen before the script finishes.
print('hello world!')
i = 0
while i < 1000000:
print('hello world number: ', i)
i += 1
虽然 >90% 的类似探测问题的解决方案都涉及更改路径,但这不是问题,因为这个应用程序基本上没有任何问题。 那么,谁能帮我让这个基本应用程序正常工作,以便我可以从那里构建和调试?
这是我使用的 PyInstaller 命令:pyinstaller helloWorldTest.py --onefile --icon=dipyIcon.icns -w --clean
【问题讨论】:
-
不完全确定为什么这被否决了。感觉像是一个公平的问题(特别是考虑到这个问题的普遍性)——我知道发布“好”问题是有规则的,但是如果没有评论或上下文,反对票只是一记耳光。这令人沮丧,坦率地说有点粗鲁。
标签: python-3.x macos pyinstaller