On Tue, Dec 28, 2010 at 8:38 PM, Kevin Huang <[email protected]> wrote: > Hi everyone, > First time writing up something in Python and trying to get it to exe for > use. I went with Python3 (3.1) and later found cx_freeze when found out that > py2exe doesn't really do the job. I wrote a script that uses tkinter for the > GUI and my exe wouldn't run. > This is the error I got for running Main.exe (my program): > ------------------------------ > D:\Programming\Workspace\PyUTF82C\src\dist>Main > Traceback (most recent call last): > File "C:\Python31\lib\site-packages\cx_Freeze\initscripts\Console3.py", > line 27, in <module> > exec(code, m.__dict__) > File "Main.py", line 324, in <module> > File "C:\Python31\lib\tkinter\__init__.py", line 1632, in __init__ > self.tk = _tkinter.create(screenName, baseName, className, interactive, > wantobjects, useTk, sync > , use) > _tkinter.TclError: Can't find a usable init.tcl in the following > directories: > {D:\Programming\Workspace\PyUTF82C\src\dist\tcl} > D:/Programming/Workspace/PyUTF82C/src/dist/tcl8 > .5 D:/Programming/Workspace/PyUTF82C/src/lib/tcl8.5 > D:/Programming/Workspace/PyUTF82C/src/lib/tcl8.5 > D:/Programming/Workspace/PyUTF82C/lib/tcl8.5 > D:/Programming/Workspace/PyUTF82C/src/library D:/Progr > amming/Workspace/PyUTF82C/library > D:/Programming/Workspace/PyUTF82C/tcl8.5.2/library D:/Programming/ > Workspace/tcl8.5.2/library > > > This probably means that Tcl wasn't installed properly.
Indeed. There is a hook for properly copying over the files required for running tcl and tk. That hook might only run properly on Unix platforms, though, as I've never actually tested on Windows. You can find it in cx_Freeze/hooks.py under the method load_Tkinter. If you can tell me what works for you I'll make sure the changes are included in the next release of cx_Freeze; otherwise, you can always look up the files manually and then use the include_files directive to ensure they are included in the build directory. Hope that all makes sense! > ------------------------------ > I'm trying to run this Main.exe on the same machine I wrote it on, and the > code works. I found some previous posts where someone had similar issues and > Tcl8.4 wasn't included, but I noticed both tcl85.dll and tk85.dll have been > copied to the /dist directory. So I assume, that the tcl and tk libraries > have been included, or partially so. Right. Just need a bunch of additional files that are part of the Tk installation. See above. > Below is the command I used to build the exe file using cx_freeze (following > the brief usage doc I found on the site). I noticed the 'm's and 'P's next > to the file names, what do they mean? m is for module and P is for package. Anthony ------------------------------------------------------------------------------ Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ cx-freeze-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/cx-freeze-users
