0

I have an application which I am trying to pack it with py2exe.

This application fisrt runs some computation operations, then output the results in a dialog.

When I run it in Python, the code works just fine, and the dialog and other components are displayed as I expected.

Then I used Py2exe to pack it into a .exe file, and run it. The conversion goes well without error report, the computation part works, but the graphical output doesn't. There should be a dialog displayed. Instead, I only see a tiny window flashed and disappeared. I think this window is for error report of wxPython.

Here is the setup.py I have:

import csv import numpy as np import sys import xlwt import wx from AccountClass import Account from NodeClass import Node from TreeClass import Tree from MonteCarloClass import MonteCarloSimulator # I put down this line to deal with the dll missing problem sys.path.append('C:\\WINDOWS\\WinSxS\\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4148_none_5090ab56bcba71c2') from distutils.core import setup import py2exe setup(console = ['main.py']) 

May I know why this is happening? Is this because the wxPython doesn't work with py2exe, or I didn't configure them correctly?

7
  • wxPython works just fine with py2exe. Can you elaborate on your 'missing dll' problem? I never encountered the need to append an SxS path to the system path in order for bundle an executable using py2exe. My guess is that whatever you were working around with this "fix" is related to the underlying cause for your issue, but I'll need more background to help. Commented Feb 21, 2014 at 18:48
  • The dll missing problem is from this link:stackoverflow.com/questions/323424/… Commented Feb 21, 2014 at 19:12
  • @g.d.d.c I've tried to exclude command in the options, then it turns out that only a build folder is created, and no .exe file is generated. Commented Feb 21, 2014 at 19:20
  • @g.d.d.c Please forget my last reply. i've tried the options just as you answered below, and created a dist folder which includes .exe file. However, again a small window pops up and disappear in a flash. Commented Feb 21, 2014 at 19:23
  • In that case, more information about what goes on inside your __name__ == '__main__' block will be relevant. Are you calling your executable from a command line, or double-clicking on it? Is there a main.exe.log file generated in the dist directory? Commented Feb 21, 2014 at 19:26

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.