Search code examples
pythonexecutablecx-freezesetup.py

What is my next step using cx_Freeze?


Ok so I have python 3.2 installed and I have cx_Freexe 4.2.3 installed. I have a folder called Python stuff. In this folder there are 2 files. setup.py and holg.py (my application)

Here is my setup.py:

import sys

from cx_Freeze import setup, Executable

build_exe_options = {"packages": ["os"], "excludes": ["tkinter"]}

base = None

if sys.platform == "win32":

    base = "Win32GUI"

setup(  name = "holgame",

        version = "0.1",

        description = "My GUI application!",

        options = {"build_exe": build_exe_options},

        executables = [Executable("holg.py", base=base)])

The next step I have been doing is Run > cmd:

python setup.py build

what I get is:

'python' is not recognized as an internal or external command, operable program or batch file.

I am only a beginner so I need clear steps. Maybe my programs should be in a different folder or something, I can't really be sure. Does anyone know what the problem is? Thanks


Solution

  • You either need to put Python on the Windows path, or you need to use an explicit path to python. Try:

    $ \Python32\Python setup.py build
    

    Here are some good instructions for getting Python installed on your Windows machine: https://openhatch.org/wiki/Boston_Python_Workshop_5/Friday/Windows_set_up_Python

    You will first need to cd to the directory containing your code and setup.py. You should find a Windows command prompt tutorial to help with some of this basic stuff.