Re: [cx-freeze-users] Error report
Brought to you by:
atuining
From: Anthony T. <ant...@gm...> - 2008-07-21 13:59:31
|
On Sun, Jul 20, 2008 at 2:10 AM, Dick Moores <rdm...@gm...> wrote: > On Sat, Jul 19, 2008 at 1:05 PM, Anthony Tuininga > <ant...@gm...> wrote: >> So my suspicion was correct. :-) You will need to have TCL installed > > Of course I have tcl installed. You mean the friend I had do the testing? Certainly. Naturally you would have TCL installed as you were not getting the error. :-) >> or you will need to copy the tcl/tcl8.4 and tcl/tk8.4 to one of the >> directories in question. > > Those directories are on my friend's computer. :) You're saying that TCL *is* installed on your friend's computer? Then I guess the Python wrapping of TCL deliberately avoids looking in the normal locations for such things. Hmm, interesting. >>Its unfortunate that TCL doesn't >> automatically search the directory or a subdirectory of the location >> where the executable is found or you could use the "include-files" >> option of cx_Freeze to perform the copy for you. > > I could find no 'include-files' option in the manual at > <E:\Python25\Lib\site-packages\cx_Freeze\cx_Freeze.html>, so I used > this as my setup.py: Sorry. This is a new option available in the trunk of Subversion, not yet released. I hope to make a new release shortly. > ===================================== > #! /usr/bin/env python > #coding=utf-8 > #setup.py > > import cx_Freeze > > includes = ['E:\Python25\tcl\tcl8.4', 'E:\Python25\tcl\tk8.4'] > > cx_Freeze.setup( > name = "randomTriangles_wo_named_colors", > version = "0.1", > description = "Random Triangles Without Named Colors", > author = "Dick Moores", > options = dict(build_exe = dict(includes = includes)), > executables = > [cx_Freeze.Executable("randomTriangles_wo_named_colors.py")]) > =================================================== > > And ran > > E:\PythonWork\cx_Freeze_packages>python setup.py build > running build > running build_exe > Traceback (most recent call last): > File "setup.py", line 15, in <module> > executables = [cx_Freeze.Executable("randomTriangles_wo_named_colors.py")]) > File "E:\Python25\Lib\site-packages\cx_Freeze\dist.py", line 266, in setup > distutils.core.setup(**attrs) > File "E:\Python25\lib\distutils\core.py", line 151, in setup > dist.run_commands() > File "E:\Python25\lib\distutils\dist.py", line 974, in run_commands > self.run_command(cmd) > File "E:\Python25\lib\distutils\dist.py", line 994, in run_command > cmd_obj.run() > File "E:\Python25\lib\distutils\command\build.py", line 112, in run > self.run_command(cmd_name) > File "E:\Python25\lib\distutils\cmd.py", line 333, in run_command > self.distribution.run_command(command) > File "E:\Python25\lib\distutils\dist.py", line 994, in run_command > cmd_obj.run() > File "E:\Python25\Lib\site-packages\cx_Freeze\dist.py", line 153, in run > freezer.Freeze() > File "E:\Python25\Lib\site-packages\cx_Freeze\freezer.py", line 387, in Freeze > self.finder = self._GetModuleFinder() > File "E:\Python25\Lib\site-packages\cx_Freeze\freezer.py", line 245, > in _GetModuleFinder > finder.IncludeModule(name) > File "E:\Python25\Lib\site-packages\cx_Freeze\finder.py", line 336, > in IncludeModule > module = self._ImportModule(name, deferredImports) > File "E:\Python25\Lib\site-packages\cx_Freeze\finder.py", line 159, > in _ImportModule > raise ImportError, "No module named %s" % name > ImportError: No module named E:\Python25\tcl\tcl8.4 > ============================================ > > So how to fix up setup.py? > It seems to want modules in the list in > include = [] Yes, this is for modules. You need to use the other option to include files, like this: includeFiles = [ ( r"E:\Python25\tcl\tcl8.4", "tcl"), ( r"E:\Python25\tcl\tk8.4", "tk") ] Then, in the same location where includes is specified, specify include_files = includeFiles. When there are enough of these, it is often helpful to do this instead: buildOptions = dict( includes = includes, include_files = includeFiles) cx_Freeze.setup( name = "randomTriangles_wo_named_colors", version = "0.1", description = "Random Triangles Without Named Colors", author = "Dick Moores", options = dict(build_exe = buildOptions), executables = [cx_Freeze.Executable("randomTriangles_wo_named_colors.py")]) Of course, none of this will help without also setting the environment variables TCL_LIBRARY and TK_LIBRARY to point to the locations where TCL and TK reside. I have added this into the initscripts and checked those in so if you grab the latest from Subversion this will be done for you already. With these steps completed I was able to successfully run a frozen application on a computer without Python or TCL installed. Hope this helps. Anthony > Dick > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > cx-freeze-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-freeze-users > |