[Python] pyinstaller macOS symbol not found

Posted in :

使用 pyinstaller 在 10.14 環境下打包的程式,在 10.10 上會顯示錯誤:

symbol not found

pyinstaller 官方說明:
https://pyinstaller.readthedocs.io/en/stable/usage.html#making-mac-os-x-apps-forward-compatible

In Mac OS X, components from one version of the OS are usually compatible with later versions, but they may not work with earlier versions.

The only way to be certain your app supports an older version of Mac OS X is to run PyInstaller in the oldest version of the OS you need to support.

For example, to be sure of compatibility with “Snow Leopard” (10.6) and later versions, you should execute PyInstaller in that environment. You would create a copy of Mac OS X 10.6, typically in a virtual machine. In it, install the desired level of Python (the default Python in Snow Leopard was 2.6, which PyInstaller no longer supports), and install PyInstaller, your source, and all its dependencies. Then build your app in that environment. It should be compatible with later versions of Mac OS X.


替代解法:

How to create simple Mac apps from shell scripts
https://mathiasbynens.be/notes/shell-script-mac-apps

platypus
http://sveinbjorn.org/platypus

py2app
https://py2app.readthedocs.io/en/latest/

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *