i m trying to create windows executable from python program which has GUI .
i m using following script
from distutils.core import setup
Warning (from warnings module):
File "C:\Python27\lib\distutils\dist.py", line 267
UserWarning: Unknown distribution option: 'console'
Traceback (most recent call last):
File "E:\my python\py2exe.py", line 3, in <module>
File "E:\my python\py2exe.py", line 5, in <module>
File "C:\Python27\lib\distutils\core.py", line 140, in setup
raise SystemExit, gen_usage(dist.script_name) + "\nerror: %s" % msg
SystemExit: usage: py2exe.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: py2exe.py --help [cmd1 cmd2 ...]
or: py2exe.py --help-commands
or: py2exe.py cmd --help
error: no commands supplied
The problem is that you are compiling this script from the Python IDLE. This is not how it is done with
py2exe. If you have used
Disutils before, you might have seen this:
python setup.py install.
And same is the case of
py2exe, you run it from the command line and not the IDLE. So open up
cmd and then issue the command:
python setup.py py2exe
setup.py is your script file.
This is better explained in the tutorial.