Я пытаюсь упаковать приложение Python Tkinter, используя cx-freeze на Ma c, используя bdist_ma c. Все компилируется, но фактический GUI отображается как черный экран (хотя виджеты все еще там, потому что я могу щелкнуть по ним). Я прикрепил свой setup.py и образец приложения Tkinter.
Edit: добавлен «os» в пакеты и удален tkinter из включенных - все еще нет прогресса.
Не уверен, что это говорит что угодно, но я пробовал bdist_ma c и bdist_dmg - ни один из них не создал файл a.dmg или .app.
setup.py:
PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__))
os.environ['TCL_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl8.6')
os.environ['TK_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tk8.6')
# Dependencies are automatically detected, but it might need
# fine tuning.
buildOptions = dict(packages=['_sysconfigdata_m_darwin_darwin', 'cairocffi', 'cairosvg', 'tkinter', 'os'], includes=[], excludes=[],
include_files=['/Users/celinaperalta/Documents/NYLTesting/rally-exports/', os.path.join(PYTHON_INSTALL_DIR, 'libtcl8.6.dylib'), os.path.join(PYTHON_INSTALL_DIR, 'libtk8.6.dylib')])
import sys
base = 'Win32GUI' if sys.platform=='win32' else None
executables = [
Executable('Test.py', base=base)
]
setup(name='RallyReportTool',
version = '1.0',
description = 'For use within New York Life CRM team',
options = dict(build_exe = buildOptions),
executables = executables)
Test.py:
from tkinter import *
def main():
window = Tk()
window.title("Welcome to Test app")
lbl = Label(window, text="Hello")
lbl.grid(column=0, row=0)
window.mainloop()
if __name__ == "__main__":
main()