Why am I getting this ImportError?

后端 未结 2 384
礼貌的吻别
礼貌的吻别 2021-01-13 21:26

I have a tkinter app that I am compiling to an .exe via py2exe.

In the setup file, I have set it to include lxml,

相关标签:
2条回答
  • 2021-01-13 21:56

    Looks like py2exe doesn't realize it should include the lxml._elementpath module, which is conditionally imported by lxml.etree. You can tell it to include that module explicitly with the includes keyword argument in your setup.py.

    setup(
        options={'py2exe': {"includes": ["lxml._elementpath"]}}
    )
    
    0 讨论(0)
  • 2021-01-13 22:14

    Py2exe has made documentation of this error on this page: http://www.py2exe.org/index.cgi/WorkingWithVariousPackagesAndModules

    They also offer a working solution.

    0 讨论(0)
提交回复
热议问题