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
from xml.etree.ElementTree import ElementTree
if __name__ == '__main__':
tree = ElementTree()
print tree.parse('lib.xml')
This should print out "< Element Library at xxxxxx>" where Library is the root name.
setup.py
from setuptools import setup
setup(name="Mac XML Test",
app=['macxml.py'],
)
What is the correct way to make the mac app utilize this library?
Python 2.6.4
Mac OS X 10.6.2
Edit: I also tried this on another mac (PPC 10.5.8) with Python 2.6.2 and achieved the same results.