Fix tcl/tk libs inclusion in tkinter with Python3.7 under MacOS
使用 Pyinstaller 打包时候报错:
3027 ERROR: Tcl/Tk improperly installed on this system.
执行的时候报错:
liyongjiandeMBP.lan [/Users/liyongjian] /Users/liyongjian/lyj/dist/ServenDigitsDrawV2 ; exit;
Traceback (most recent call last):
File “PyInstaller/loader/rthooks/pyi_rth__tkinter.py”, line 28, in
FileNotFoundError: Tcl data directory “/var/folders/f9/6m090zhs6w55rmbmhkmpff440000gn/T/_MEITVlJln/tcl” not found.
[39503] Failed to execute script pyi_rth__tkinter
解决办法:
在文件yInstaller/hooks/hook-_tkinter.py中增加
and ‘Python’ not in path_to_tcl
@@ -180,7 +180