1

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

  • Hey Adam, thanks for the response. For some reason I'm win32 but running 64 bit. Could this be the problem and I just need to install the 32 bit Python. Sorry, I'm a rookie. – Patrick Dawson Feb 01 '16 at 23:02
  • 2
    for what it's worth, freezing Python code has always been a pain in my side, and I've been doing this for *years*. – Adam Smith Feb 01 '16 at 23:04
  • [The docs](https://docs.python.org/3/library/sys.html#sys.platform) explain that (confusingly) *all* versions of windows will report `'win32'`. My mistake. – Adam Smith Feb 01 '16 at 23:07
  • Interesting. Still trying to figure out why my .exe will not open. Everything seems to build fine and the icon is even set. When I double click, nothing happens. – Patrick Dawson Feb 02 '16 at 13:56

0 Answers0