Wednesday, 15 September 2010

pyqt - CxFreeze is not recognizing certain imports -



pyqt - CxFreeze is not recognizing certain imports -

after building executable cx_freeze , trying run .exe error. understand means cxfreeze not recognizing lxml. have tried include in setup.py

traceback(most recent phone call last): file "c:\python27\lib\site-packages\cx_freeze\initscripts\console.py", line 27, in <module> exec(code, m._dict_) file "mainfile.py", line 2, in <module> file "c:\users\user\testfile\testpyqt.py",line 11, in <module> import myfile file "c:\users\user\testfile\myfile.py", line 4, in <module> lxml import etree file "extensionloader_lxml_etree.py", line 22, in <module> file "extensionloader_lxml_etree.py", line 14, in _bootstrap_ file "lxml.etree.pyx", line 84, in init lxml.etree (src\lxml\lxml.etree.c:191837) importerror:cannot import name_elementpath

my setup.py has this:

include_modules = [ 'lxml', 'xml.etree.elementtree', 'xml.etree.elementpath', 'libxml2' ]

it looks little error message missing space. i'm pretty sure complaining `lxml._elementpath' cannot imported. because module conditionally imported lxml.

the solution add together lxml._elementpath list of include_modules.

note, solution comes these sources, people had similar problems py2exe or other packages cx_freeze:

why getting importerror?

cx_freeze importerror: cannot import name

pyqt lxml libxml2 cx-freeze

No comments:

Post a Comment