[已解决]windows下xpath模块无法在py2exe中打包

[已解决]windows下xpath模块无法在py2exe中打包

所用工具版本号:
python 2.5.2
4Suite-XML-1.0.2.win32-py2.5.exe
py2exe-0.6.9.win32-py2.5.exe

如下代码:(xpath.py)
from Ft.Xml import Parse
doc = Parse("<spam>eggs<eggs n='1'> and ham</eggs></spam>")
max=doc.xpath(u'''string(//eggs)''')
print max
#result:  and ha


直接执行,其结果是:
:  and ha

但是我将该代码以py2exe形式打包,
from distutils.core import setup
import py2exe

setup( console=['xpath.py']


执行dist下xpath.exe文件,输出:
FtWarning: Catalog resource (pep302://Ft.Xml/Share/default.cat) disabled: Error
retrieving resource 'pep302://Ft.Xml/Share/default.cat': <urlopen error [Errno
0] Error: 'Share\\default.cat'>
Traceback (most recent call last):
  File "xpath.py", line 2, in <module>
  File "Ft\Xml\__init__.pyc", line 280, in Parse
  File "Ft\Xml\Domlette.pyc", line 38, in <module>
  File "Ft\Xml\cDomlette.pyc", line 15, in <module>
  File "Ft\Xml\cDomlettec.pyc", line 12, in <module>
  File "Ft\Xml\cDomlettec.pyc", line 10, in __load
ImportError: No module named XInclude


请教,如何修复以上问题?谢谢。

问题解决:在setup.py中添加所需要的模块名称即可。