python program works but .exe does not open cx_Freeze

人盡茶涼 提交于 2019-12-23 02:16:15

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!