Try adding both packages and includes - It work for me
packages = ['lxml']
includes = ['lxml','lxml.etree','lxml._elementpath','lxml.ElementInclude']
From: David Touchette [mailto:[email protected]]
Sent: Friday, August 19, 2011 5:06 PM
To: [email protected]
Subject: [cx-freeze-users] no module named lxml
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