python中使用到lxml模块时,py2exe打包方法
最近用python写了一个小软件,用到lxml模块。运行正常,但使用py2exe打包后无法运行:
命令行打包命令 :
python setup.py py2exe
打包后运行.exelog文件内容如下:
Traceback (most recent call last):
? File "testGUI.py", line 15, in <module>
? File "zipextimporter.pyo", line 98, in load_module
? File "lxml.etree.pyx", line 39, in init lxml.etree (src/lxml/lxml.etree.c:140909)
ImportError: No module named _elementpath
最终将打包命令变为:python setup.py pyexe -p lxml,gzip 后成功