py2exe - create one EXE

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • codecraig

    #1

    py2exe - create one EXE

    Hi,
    Is there a way to create one .exe using py2exe (or some other
    extension/utility that can do it)?

    Basically i want to generate one .exe that contains everything my
    python app needs to run instead of having a .exe, some .zips, etc.

    thanks

  • Fredrik Lundh

    #2
    Re: py2exe - create one EXE

    "codecraig" wrote:
    [color=blue]
    > Is there a way to create one .exe using py2exe (or some other
    > extension/utility that can do it)?
    >
    > Basically i want to generate one .exe that contains everything my
    > python app needs to run instead of having a .exe, some .zips, etc.[/color]

    hmm. if you cannot access google, how come you're able to post via
    google groups?

    here's the first google hit for "py2exe single exe"



    (that page also happens to be linked from the front page on the py2exe
    support wiki)

    </F>



    Comment

    • codecraig

      #3
      Re: py2exe - create one EXE

      must have missed it on py2exe front page....and for google i didnt try
      that search exactly. Thanks though. I was trying like "one executable
      py2exe", etc.

      Comment

      • Simon John

        #4
        Re: py2exe - create one EXE

        yeah, the question does come up once a month at least, but you could
        try mcmillan installer with it's --onefile option.

        i have mirrors at http://www.the-jedi.co.uk/downloads/installer

        Comment

        • codecraig

          #5
          Re: py2exe - create one EXE

          I tried the installer v6...and i generated a spec, and i built the
          exe...when i run the exe i get a error popup window from Windows asking
          me to send an Error report.

          The warnings that were generated during the build all appear to be
          "ignorable" as the documentation mentions.

          any ideas?

          Comment

          • codecraig

            #6
            Re: py2exe - create one EXE

            oh and Fredrik, i tried the SingleInstaller link....which points to a
            script using NSIS. I followed those instructions which generated an
            ..exe. HOwever, when i run the .exe nothing happens (meaning no
            process starts, no output, no errors, nothing).

            any ideas on that? have ever used it?

            Comment

            • James Carroll

              #7
              Re: py2exe - create one EXE

              I like that you can automatically invoke NSIS and create an installer,
              but I thought the question was how can all of the libraries be in a
              single runnable program executable (not a program that installs, but
              the program that you wrote.)

              I don't think you can do this, because (unless you have your own
              version of python that statically links with all of the module's
              native code that you need) you would have to have some code that loads
              DLLs that are packed in your executable at the moment that the import
              happens for that module.

              Please correct me if I'm wrong, I'd love to minimize the files that
              have to be in the same directory as my executable (or nearby, or in a
              common lib dir.)

              (sorry you got this twice Craig.)

              -Jim

              Comment

              • codecraig

                #8
                Re: py2exe - create one EXE

                So how there is currently available way to have 1 .exe which includes
                everything needed to run a python app?

                :sigh:

                Comment

                • Fredrik Lundh

                  #9
                  Re: py2exe - create one EXE

                  James Carrol wrote:
                  [color=blue]
                  > I like that you can automatically invoke NSIS and create an installer,
                  > but I thought the question was how can all of the libraries be in a
                  > single runnable program executable (not a program that installs, but
                  > the program that you wrote.)[/color]

                  the wiki recipe does exactly that -- it creates one EXE, which *temporarily*
                  unpacks the components that have be in separate files for Windows to find
                  them. when you terminate the program, the files are removed.
                  [color=blue]
                  > I don't think you can do this, because (unless you have your own
                  > version of python that statically links with all of the module's
                  > native code that you need) you would have to have some code that loads
                  > DLLs that are packed in your executable at the moment that the import
                  > happens for that module.[/color]

                  there are commerical libraries available that overrides Win32 API calls
                  so they fetch data from resources rather than disk files. but given that
                  disks are fast and disk space is cheap, it's hardly worth the effort.

                  </F>

                  Comment

                  • codecraig

                    #10
                    Re: py2exe - create one EXE

                    fredrik...

                    any ideas on my last post? (copied below for u)

                    oh and Fredrik, i tried the SingleInstaller link....which points to a
                    script using NSIS. I followed those instructions which generated an
                    ..exe. HOwever, when i run the .exe nothing happens (meaning no
                    process starts, no output, no errors, nothing).

                    any ideas on that? have ever used it?

                    thanks

                    Comment

                    Working...