Hi,
The main reason you are having difficulty is because of the fact that
you are trying to write the executable to a different directory (dist)
and everything else that is needed is written to the build
subdirectory. So when you run the executable in dist it can't find the
modules. Let me suggest that you remove the targetDir = "dist"
directive in your setup.py and the results should work out much
better. In fact in most cases you can simply do
cx_Freeze.Executable("Voltron.py") and everything will work as
expected. You will also need to specify packages = ["lxml"] as
suggested by Hien Pham in order for this script to work properly.
Hope this helps you out.
Anthony
On Fri, Aug 19, 2011 at 3:05 PM, David Touchette
<[email protected]> wrote:
>
> Greetings,
> I'm trying to freeze a relatively simple script, but without much luck.
> Win7 x64 || XP 32
> Python 3.2 || Python 2.7
> Latest sourceforge download of cx_freeze
> The error I get is:
> ---------------------------
> cx_Freeze: Python error in main script (traceback unavailable)
> ---------------------------
> Cannot import traceback module.
> Exception: No module named re
> Original Exception: No module named lxml
> ---------------------------
> The setup.py I am using is as follows:
> ---------------------------
> from cx_Freeze import setup, Executable
> includes = ['re', 'lxml.etree', 'gzip', 'inspect']
> excludes = []
> packages = []
> path = []
> EXE_Target = Executable(
> # what to build
> script = "Voltron.py",
> initScript = None,
> base = 'Win32GUI',
> targetDir = r"dist",
> targetName = "voltron.exe",
> compress = True,
> copyDependentFiles = True,
> appendScriptToExe = False,
> appendScriptToLibrary = False,
> icon = None
> )
> setup(
> version = "1.2",
> description = "Legacy file transmorgificationer",
> author = "D. Touchette",
> name = "Voltron Transmorgificationer",
> options = {"build_exe": {"includes": includes,
> "excludes": excludes,
> "packages": packages,
> "path": path
> }
> },
> executables = [EXE_Target]
> )
> ---------------------------
> The script reads a file and does an xslt transform and a few tweaks before
> writing out a new XML file. I actually don't use "re" but cx_freeze was
> complaining about not having module re so I included it for fun.
> Here is the imports of my script:
> ---------------------------
> from lxml import etree
> import re
> import os
> import io
> import time
> ---------------------------
> Any help would be great, spent the day researching and trying different
> things. Same error in XP vs. W7
> D.
>
> ------------------------------------------------------------------------------
> Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
> user administration capabilities and model configuration. Take
> the hassle out of deploying and managing Subversion and the
> tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
> _______________________________________________
> cx-freeze-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cx-freeze-users
>
>
------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
user administration capabilities and model configuration. Take
the hassle out of deploying and managing Subversion and the
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
cx-freeze-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cx-freeze-users