0

I've created this question relative to my other one - How to include modules in Cx_freeze, but decided that wasn't really realtive to my current question.

When i freeze my program, which uses easygui, I get a whole bunch of errors about missing modules, Yes - easygui is installed Python32, And Yes - Easygui is in site - packages,

Any Help would be appreciated, and FYI i'm using the basic setup.py ;)

from cx_Freeze import setup, Executable

setup(
        name = "GUIproject",
        version = "0.1",
        description = "Sample Test easygui",
        executables = [Executable("GUIproject.py")])

The modules it reports are missing include PIL, StringIO, Tkinter and tkFileDialog.

Thomas K
  • 39,200
  • 7
  • 84
  • 86
Joseph Smith
  • 3,243
  • 5
  • 20
  • 18

1 Answers1

0

It's probably fine - see this answer about why missing modules aren't a problem.

In this case, PIL is optional for Easygui, and the other 3 are Python 2 names. Easygui will import the Python 3 names instead (you're running Python 3.2) - something like this:

try:
    import tkinter  # Python 3
except ImportError:
    import Tkinter as tkinter  # Python 2

So you should get an output exe file anyway - try running it, and see if it works.

Community
  • 1
  • 1
Thomas K
  • 39,200
  • 7
  • 84
  • 86
  • I have a build Folder with the .exe in it, however when i try to run it. it comes up with a command line window, and an error that turns off really quickly, i managed to gather that it said A whole bunch of tracebacks, but at the last line it said " This probably means that TCL wasn't installed properly" - Whats TCL ? Oh, and i tried that snippet, and it worked. – Joseph Smith May 18 '12 at 03:53
  • Tcl is needed for Tkinter, which is what easygui uses to make an interface. The way you're building it, you get a command line application, so either run it from the command line, or set `base='Win32GUI'`, like in [the example](http://cx_freeze.readthedocs.org/en/latest/distutils.html). – Thomas K May 18 '12 at 11:33
  • I still get a whole lot of missing modules errors again. Ran the .exe and i get Original Exception, No module named tkinter, do i need to have tkinter installed? – Joseph Smith May 21 '12 at 00:49
  • Is it possible for me to send you the error when i run the .exe? I also removed the code excludes = ['tkinter' ]} However that gave me the error message that i got when i tried to run the .exe and opened with command prompt – Joseph Smith May 21 '12 at 01:34
  • Oh yes, you don't want to exclude tkinter, that's quite important ;-). You're welcome to post the error message here (ask a new question) or on the cx_Freeze [mailing list](https://lists.sourceforge.net/lists/listinfo/cx-freeze-users). – Thomas K May 21 '12 at 11:38
  • I removed the exclude, and when i tried to run the .exe it gave me the error i got when i ran the .exe with the exclude - TCL might not be installed correctly? I'm stumped -_- :P – Joseph Smith May 21 '12 at 23:53
  • So am I! Have you definitely got the latest released version of cx_Freeze, 4.2.3? You could also try with the development version, if you want: https://bitbucket.org/anthony_tuininga/cx_freeze/get/default.zip – Thomas K May 22 '12 at 12:05
  • It might have been updated since i last used it, i'll try that one now ;) – Joseph Smith May 23 '12 at 01:47
  • Downloaded it, how exactly do i install it? Last time i used it i got an .msi? – Joseph Smith May 23 '12 at 02:23
  • Yeah, that could get a bit complicated. You'd need Visual studio express installed so you can compile bits of it. Probably the best thing is for you to post the full error you're getting on the cx_Freeze mailing list. Hopefully someone will be able to give you a more definite answer about whether it's been fixed. – Thomas K May 23 '12 at 12:22
  • How do i get to the mailing list? The only Errors i get Are, Modules Missing - Blah,Blah TCL not installed correctly – Joseph Smith May 24 '12 at 04:10
  • Modules missing isn't necessarily a problem, but I don't know about the Tcl thing. The mailing list is here: https://lists.sourceforge.net/lists/listinfo/cx-freeze-users – Thomas K May 25 '12 at 11:33
  • I sent an email, however it got auto - rejected. I cant find anything online, might just have to give this up. – Joseph Smith May 30 '12 at 22:59
  • @Joseph: It should tell you the reason for the rejection - you probably have to sign up to the mailing list before posting (to ensure any replies get to you). – Thomas K May 30 '12 at 23:27
  • Fair Point ;) I'll go register now. – Joseph Smith May 31 '12 at 21:38