4

I'm still new to Python and py2exe. I've created an executable from py2exe, but when I try to copy the single .executable from the "dist" folder it was created in, and paste it else where (let's say my desktop), When I open the executable after it's moved from the folder it opens quickly disappears (it's a console application). The program has several input/output, so this should not be the case. Its DOES function correctly if I leave it the original "dist" folder.

Is there something I'm missing? What do I need to do if I just want to take the single file (.exe) and put it on a different machine (that doesn't have Python installed) and get it to run correctly?

Thanks in advance!

Skizz
  • 1,405
  • 2
  • 11
  • 12
  • 2
    Run it with Command Prompt to see what the output of the window is. There's an error, but you don't know what it is. – Blender Apr 05 '11 at 16:45
  • I use `cx_freeze`, which seems to work better (for me) than `py2exe`. So if `py2exe` doesn't work, read this question to see some other alternatives: http://stackoverflow.com/questions/1689086/are-there-any-alternatives-to-py2exe. – Blender Apr 05 '11 at 16:47
  • Consider creating a [single-file executable](http://stackoverflow.com/a/113014/1497596). – DavidRR Feb 05 '15 at 17:24

3 Answers3

6

In the dist directory is there a set of .dll files needed to run the exe file.

midtiby
  • 14,550
  • 6
  • 34
  • 43
  • 1
    I added msvcr90.dll and python27.dll to the desktop, and it worked. Is there any other way around dragging those 2 dll's around with the .exe? – Skizz Apr 05 '11 at 17:24
  • Add them to a path where windows will search for them. – midtiby Apr 06 '11 at 10:13
0

As others said, you need the .dll files to run the program. It works however if you leave the program in the dist folder (or create a copy of dist) and create a shortcut. You can move the shortcut wherever you like and it will work, since the file itself is still in the folder with the .dlls.

EAR47
  • 1
0

Put your dist folder into the system search path, and it should work fine. This happened to me also in times past.