1

I've made a GUI in wxPython and functions which use numpy and matplotlib. At first, it has asked for MSVCP90.dll. I somehow downloaded it and added to the python DLLs. Now, it generates the .exe file for the project but it doesn't work. It just opens the 'cmd' and closes down immediately. I suspect there's some problem with the project directory structure.

-- setup.py --

import py2exe, sys, os

setup(scripts=["Source\mainModule.py"],
  packages=[
    "Source",
    "Source.Packages_Needed",
    "Source.Packages_Needed.anomalyChecker",
    "Source.Packages_Needed.config",
    "Source.Packages_Needed.GUI_tools",
    "Source.Packages_Needed.parserTools",
    "Source.Packages_Needed.utilities",
    ],
  package_data={"Source.ltePackages.configuration" : ["*.txt"]},

)

-- setup.py --

-- Project Directory structure --

project/
      setup.py
      Source/
           mainModule.py
           __init__.py
           packages_Needed/
               __init__.py
               anomalyChecker/
                    __init__.py
                    ACModule1.py
                    ACModule2.py
                    ACModule3.py
               config/
                    __init__.py
                    dictionary.txt
                    reference.txt
                    configMod1.py
                    configMod2.py
                    configMod3.py
               GUI_tools/
                    __init__.py
                    analyzerGUI.py
               parserTools/
                    __init__.py
                    parser.py
               utilities/
                    __init__.py
                    plotter.py

-- Project Directory structure --

I'm running the python setup.py in the following way:

     C:\\Path\\source> python setup.py py2exe

After giving that command, I'm getting a .exe file in dist which isn't running.. it just opens a cmd and terminates immediately.

Being a newbie to python, I have two doubts :

Part - 1 of my doubt : Why is the .exe file not working ? Is there any mistake in my setup.py. If so, please point it out.

Part -2 of my doubt :

Now that, I added MSVCP90.dll . After successfully making a running .exe, Do the other system need to copy this dll into its python dlls if it runs my .exe? If so, that'll be a lot of inconvenience. Suggest a way to avoid it.

Thanks in advance.

Edit : I'm using packages : matplotlib and numpy.

VoodooChild92
  • 1,993
  • 3
  • 19
  • 24
  • 3
    Run the `.exe` from the command prompt and see if there are any errors reported. – Burhan Khalid Jul 03 '12 at 10:27
  • 1
    Please refer the SO question [Create Python EXE without MSVCP90.dll](http://stackoverflow.com/questions/10060765/create-python-exe-without-msvcp90-dll/10060842#10060842) – Abhijit Jul 03 '12 at 10:28
  • Hmm... Thanks for pointing it out. Error : Traceback (most recent call last): File "mainModule.py", line 3, in ImportError: No module named packages_Needed.GUI_tools.analyzerGUI – VoodooChild92 Jul 03 '12 at 10:31
  • 1
    @user673919: According to your project structure it should be `packages_Needed.GUI_Tools.analyzerGUI`. Noticed the `T` in `tools`. – RanRag Jul 03 '12 at 10:38
  • Oh so sorry.. just a mistake in the question. It's perfectly correct in the code.. My bad. – VoodooChild92 Jul 03 '12 at 10:41
  • @user673919: No, see your error it is saying that there is no module named `packages_Needed.GUI_tools.analyzerGUI ` because it should be `packages_Needed.GUI_Tools.analyzerGUI ` wherever you are trying to import it. – RanRag Jul 03 '12 at 10:43
  • @user673919: The error is in file `mainModule.py` show us the contents of that file. – RanRag Jul 03 '12 at 10:45

1 Answers1

1

i have got the same problem whith my gui on pyqt, it was resolved by including the pyqt module i was using like this

setup(windows=[{"script":"myGuy.py",
  data_files = Mydata_files,
  options={"py2exe":{"includes":["sip", "PyQt4.QtCore","PyQt4.QtGui","PyQt4.QtNetwork"],'dist_dir': "myGuiNameDir"

}})

Add the options variable and Try to replace the list with ["PyQt4.QtCore", "PyQt4.QtGui"] by the wxPython modules you are using. Let me know if it worked.

also, if u are tired of the dist directory named dist, u can use the 'dist dir' to change hi name

Ennakard
  • 116
  • 1
  • 2
  • 9