问题
So my program works fine in PyCharm but for some reason when I create a .exe using cx_freeze it won't open. Everything goes fine with the build and my .exe is created but when I try to open it, nothing happens.
This is my first time creating a .exe and I have tried it with another (more simple) script and it still does not open!
See my below setup.py:
import cx_Freeze
import sys
base = None
if sys.platform=='win32':
base="Win32GUI"
executables=[cx_Freeze.Executable("MyDog.py",base=base)]
cx_Freeze.setup(
name="Cable Calculator",
option={"build_exe":{"packages":["tkinter","matplotlib"]}},
version="0.01",
description="Calculator",
executables=executables
)
I'm not sure if I am just totally missing something or what. Also, I am having to set both the TK and TCL libraries before I build using the following.
set TCL_LIBRARY=C:\Users\Patrick\WinPython-64bit-3.5.1.1build7\python-3.5.1.amd64\tcl\tcl8.6\
set TK_LIBRARY=C:\Users\Patrick\WinPython-64bit-3.5.1.1build7\python-3.5.1.amd64\tcl\tk8.6\
I appreciate any help I can get.
-PD
来源:https://stackoverflow.com/questions/35141781/python-program-works-but-exe-does-not-open-cx-freeze