py2app and xml.etree.ElementTree

dirac

New Member
I'm trying to build an app that uses some xml data using Python's built-in xml.etree.ElementTree class. It works properly when I run from the command line, but when I build it, I get an error "ImportError: No module etree.ElementTree." I'm guessing this is because I'm not importing that module correctly, but I haven't been able to figure out how. When I use the "includes" or "packages" directive, py2app complains with the same error, and when I specifically specify the package_dir (/System/Library/...), it compiles, but still gives me the error. I've included a short example to illustrate the issue.macxml.py\[code\]from xml.etree.ElementTree import ElementTreeif __name__ == '__main__': tree = ElementTree() print tree.parse('lib.xml')\[/code\]This should print out "< Element Library at xxxxxx>" where Library is the root name.setup.py\[code\]from setuptools import setupsetup(name="Mac XML Test", app=['macxml.py'], )\[/code\]What is the correct way to make the mac app utilize this library?Python 2.6.4Mac OS X 10.6.2Edit: I also tried this on another mac (PPC 10.5.8) with Python 2.6.2 and achieved the same results.
 
Top