cx_Freeze error: no commands supplied
<p>I'm trying to create a executable from my .py file.</p>

<p>I did this:</p>

<pre><code>import cx_Freeze

executables = [cx_Freeze.Executable("Cobra.py")]

cx_Freeze.setup(name="Snake Python", options={"build_exe":{"packages":["pygame","time","sys","os","random"]}}, executables = executables)
</code></pre>

<p>And run from Python GUI. It returns the follow erros:</p>

<pre><code>Traceback (most recent call last):
  File "C:/Users/victor/Desktop/tcc/Jogo_Cobra/setup.py", line 5, in &lt;module&gt;
    cx_Freeze.setup(name="Snake Python", options={"build_exe":{"packages":["pygame","time","sys","os","random"]}}, executables = executables)
  File "C:\Python32\lib\site-packages\cx_Freeze\dist.py", line 365, in setup
    distutils.core.setup(**attrs)
  File "C:\Python32\lib\distutils\core.py", line 137, in setup
    raise SystemExit(gen_usage(dist.script_name) + "\nerror: %s" % msg)
SystemExit: usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help
error: no commands supplies
</code></pre>

<p>I using Python 3.2 on windows 8.1 and cx_Freeze-4.3.2.win32-py3.2</p>

<p>thanks for any help!</p>

<p>You need to actually pass a command to <code>setup.py</code> to tell it to build the executable</p>

<pre><code>python setup.py build
</code></pre>

<blockquote>
  <p>This command will create a subdirectory called <code>build</code> with a further subdirectory starting with the letters <code>exe.</code> and ending with the typical identifier for the platform that distutils uses</p>
</blockquote>

<p>Alternately you can have it build the executable and wrap it in an installer for easy distribution</p>

<pre><code>python setup.py bdist_msi
</code></pre>

python cx-freeze