小编Mar*_*eke的帖子

双击使用 pyinstaller 构建的 OS X 应用程序包不会打开该应用程序,但可以从该包中运行可执行文件。怎么了?

当我尝试使用 pyinstaller 在 OS X 上构建这个应用程序时,应用程序包不起作用。

从查找器中双击捆绑包没有任何作用。

  • 操作系统版本:OS X High Sierra 10.13.6

  • 蟒蛇:3.6.3

  • pyinstaller: 3.3.1 (也试过 3.4.dev0+380ab20f8)

我构建的应用程序如下: pyinstaller --windowed mindfulness-at-the-computer-macos.spec

在寻找答案时,我发现(除其他外)以下帖子,但它们并没有多大帮助

为了确保问题不在我们的代码中,我尝试构建本文档中概述的简单示例(一直向下滚动代码):

https://pythonhosted.org/PyInstaller/runtime-information.html#run-time-information

这有同样的问题。

我是这样构建的: pyinstaller -w directories.py

当我用 python 运行它时,我得到了这个:

python directories.py

we are not frozen
bundle dir is /Users/marieke/myprojects/test
sys.argv[0] is directories.py
sys.executable is /Users/marieke/myprojects/test/venv/bin/python
os.getcwd is /Users/marieke/myprojects/test
Run Code Online (Sandbox Code Playgroud)

当我从 /Users/marieke/myprojects/test/dist/directories.app/Contents/MacOS 在终端中运行它时

./directories

we are ever so frozen
bundle dir is /Users/marieke/myprojects/test/dist/directories.app/Contents/MacOS
sys.argv[0] …
Run Code Online (Sandbox Code Playgroud)

python macos pyinstaller app-bundle

6
推荐指数
0
解决办法
1873
查看次数

标签 统计

app-bundle ×1

macos ×1

pyinstaller ×1

python ×1