我有一个tkinter
应用程序,我正在编译为.exe
通过py2exe
。为什么我得到这个ImportError?
在安装文件,我已经将它设置为包括lxml
,urllib
,lxml.html
,ast
和math
。
当我在CMD控制台中运行python setup.py py2exe
时,它编译得很好。然后我去到它创建的dist
文件夹,然后运行.exe
文件。
当我运行.exe
我得到这个弹出窗口。 this http://gyazo.com/02fc6000c94c165a696d5072738c676d.png
然后我开始打开Trader.exe.log
文件,内容如下:
Traceback (most recent call last):
File "Trader.py", line 1, in <module>
File "lxml\html\__init__.pyc", line 42, in <module>
File "lxml\etree.pyc", line 12, in <module>
File "lxml\etree.pyc", line 10, in __load
File "lxml.etree.pyx", line 84, in init lxml.etree (src\lxml\lxml.etree.c:190292)
ImportError: cannot import name _elementpath
包括here是我setup.py
文件的副本。
请帮我看看这里的问题。提前致谢。
这是一个重复我想你可以在这里找到答案http://stackoverflow.com/questions/5308760/py2exe-lxml-woes – PyNEwbie