本来自己用不封装也是可以的,无奈 ld 有要求,必须是 app 的,不能是那种难看的终端界面,求解决方案:
github 的地址:
https://github.com/hkslover/ximalaya一开始无法调用 tk,
google 了下,按如下解决:
and 'Python' not in path_to_tcl
PyInstaller/hooks/
hook-_tkinter.py@@ -, +, @@ def _find_tcl_tk(hook_api):
# _tkinter depends on Tcl/Tk compiled as frameworks.
path_to_tcl = bins[][]
- if 'Library/Frameworks' in path_to_tcl:
+ if 'Library/Frameworks' in path_to_tcl and 'Python' not in path_to_tcl:
这样的话,直接运行.exec 文件是可以运行,但是.app 无法运行。
exec 运行之后显示:
Last login: Sun Mar 1 17:21:23 on ttys001
/Users/justin/Documents/GitHub/ximalaya/dist/main.app/Contents/MacOS/main ; exit;
justin@Justins-IMac ~ % /Users/justin/Documents/GitHub/ximalaya/dist/main.app/Contents/MacOS/main ; exit;
google 了半天实在没办法了,望指导。谢谢
系统:mac os 10.15.3
python version:3.8.1