Problem using Py2exe

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Loismustdie129
    New Member
    • Aug 2006
    • 194

    Problem using Py2exe

    I need help with a py2exe example I am working on to get the basics. The example is:

    Code:
    # setup.py
    from distutils.core import setup
    import py2exe
    setup(name="wxTail",scripts=["wxTail.py"],)
    I type this in and then I get the error message:

    Code:
    Traceback (most recent call last):
      File "<pyshell#2>", line 1, in -toplevel-
        setup(name="wxTail",scripts=["wxTail.py"],)
      File "C:\Python24\lib\distutils\core.py", line 137, in setup
        raise SystemExit, gen_usage(dist.script_name) + "\nerror: %s" % msg
    SystemExit: usage:  [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or:  --help [cmd1 cmd2 ...]
       or:  --help-commands
       or:  cmd --help
    
    error: no commands supplied
    What I want to know is what does this mean and what is the Setup() command do.

    Thanks for any help.
  • bartonc
    Recognized Expert Expert
    • Sep 2006
    • 6478

    #2
    Here is a link to true911m's Simple guide to using py2exe.

    Comment

    • Loismustdie129
      New Member
      • Aug 2006
      • 194

      #3
      Originally posted by true911m
      Code:
      #!/usr/bin/env python
      from distutils.core import setup
      import py2exe
      
      setup(
          console=["HelloWorld.py"],
          zipfile=None
           )
      I tried this code out and I got an error message reading:

      Traceback (most recent call last):
      File "<pyshell#6 >", line 3, in -toplevel-
      zipfile= None
      File "C:\Python24\li b\distutils\cor e.py", line 137, in setup
      raise SystemExit, gen_usage(dist. script_name) + "\nerror: %s" % msg
      SystemExit: usage: [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
      or: --help [cmd1 cmd2 ...]
      or: --help-commands
      or: cmd --help

      error: no commands supplied
      any thoughts on it?

      Comment

      • bartonc
        Recognized Expert Expert
        • Sep 2006
        • 6478

        #4
        Originally posted by Loismustdie129
        I tried this code out and I got an error message.
        any thoughts on it?
        It needs to be called from the commend line like this:
        Code:
        python setup.py py2exe --bundle 1
        .
        How did you invoke you script?

        Comment

        • Loismustdie129
          New Member
          • Aug 2006
          • 194

          #5
          I took that code and put it into my editor, IDLE, and when I hit enter to get out of the "setup" function it returned that error, I never saved anything cause of the error.

          Comment

          • bartonc
            Recognized Expert Expert
            • Sep 2006
            • 6478

            #6
            Originally posted by Loismustdie129
            I took that code and put it into my editor, IDLE, and when I hit enter to get out of the "setup" function it returned that error, I never saved anything cause of the error.
            There's your problem. IDLE was never quite finished. The Run Module in the Run menu doesn't pass any command line arguments that way that other IDEs do. Follow all the steps in true911m's tutorial. His way uses a batch file to execute setup.py with arguments. This can also be done from a DOS command prompt, but changing directories in there becomes tedious (at best).

            Comment

            • true911m
              New Member
              • Dec 2006
              • 92

              #7
              I created another walkthrough for PyInstaller if anyone would rather try that.

              Comment

              • bartonc
                Recognized Expert Expert
                • Sep 2006
                • 6478

                #8
                Originally posted by true911m
                I created another walkthrough for PyInstaller if anyone would rather try that.
                You make this forum a smarter place. Thanks for your contributions!

                Comment

                Working...