6

当我尝试使用 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

当我从 /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] is ./directories
sys.executable is /Users/marieke/myprojects/test/dist/directories.app/Contents/MacOS/directories
os.getcwd is /Users/marieke/myprojects/test/dist/directories.app/Contents/MacOS

当我在 /Users/marieke/myprojects/test/dist/directories.app/Contents/MacOS 的 finder 中运行它时

/Users/marieke/myprojects/test/dist/directories.app/Contents/MacOS/directories ; exit;

we are ever so frozen
bundle dir is /Users/marieke/myprojects/test/dist/directories.app/Contents/MacOS
sys.argv[0] is /Users/marieke/myprojects/test/dist/directories.app/Contents/MacOS/directories
sys.executable is /Users/marieke/myprojects/test/dist/directories.app/Contents/MacOS/directories
os.getcwd is /Users/marieke

当我双击捆绑包时,它不会运行。当我open -a directories.app从终端运行时,它也不会运行。

在控制台应用程序中,我只看到一条 launchservicesd 消息CHECKIN:0x0-0x97097 5878 directories。没有其他的。

二进制文件的访问权限是 -rwxr-xr-x@

Info.plist文件如下:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict><key>CFBundleDisplayName</key>
<string>directories</string>
<key>CFBundleName</key>
<string>directories</string>
<key>CFBundleIdentifier</key>
<string>directories</string>
<key>CFBundleExecutable</key>
<string>MacOS/directories</string>
<key>CFBundleIconFile</key>
<string>icon-windowed.icns</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.0.0</string>
<key>LSBackgroundOnly</key>
<string>0</string>
</dict>
</plist>

有趣的是,直到 3 个月前,我们还能够构建一个工作包。所以与此同时,显然发生了一些我还找不到的奇怪事情。

我会非常感谢一些帮助!

4

0 回答 0