You explicitly told setup.py
to depend on a package named elementtree
here:
"packages": ["elementtree", "xml"]}}
There is no such package in the stdlib. There's xml.etree
, but obviously that's the same name.
The example you found is apparently designed for someone who has installed the third-party package elementtree
, which is necessary if you need features added after Python 2.6's version of xml.etree
, or if you need to work with Python 1.5-2.4, but not if you just want to use Python 2.6's version. (And anyway, if you do need the third-party package… then you have to install it or it won't work, obviously.)
So, just don't do that, and that error will go away.
Also, if your code—or the code you import (e.g., xlrd
) is using xml.etree.cElementTree
, then, as the py2exe FAQ
says, you must also import xml.etree.ElementTree
before using it to get it working. (And you also may need to specify it manually as a dependency.)
You presumably don't want to change all the third-party modules you're using… but I believe that making sure to import xml.etree.ElementTree
before importing any of those third-party modules works fine.