I have a wxpython application that depends on lxml and works well when running it through the python interpreter. However, when creating an exe with py2exe, I got this error
ImportError: No module named _elementpath
I then used python setup.py py2exe -p lxml
and I did not get the above error but
another one saying
ImportError: No module named gzip
Could anyone let me know what the problem is and how I can fix it. Also should I put any
dll files like libxml2, libxslt etc in my dist folder? I searched the computer
and did not find these files, so maybe they aren't needed?
Thanks.
Edit: I just tried with python setup.py py2exe -p -i gzip
and the exe was created. But the exe generated does not run. I double click it and it doesn't do anything.
Here's the setup.py script i'm using
from py2exe.build_exe import py2exe
from distutils.core import setup
setup( windows=[{"script": "gui.py"}] )
Edit2: I tried using cx_freeze as an alternative , but got the same
ImportError: No module named _elementpath
error. Didn't know how to proceed after that.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…