Problem using py2app with the lxml package

后端 未结 4 879
迷失自我
迷失自我 2021-02-09 21:54

I am trying to use \'py2app\' to generate a standalone application from some Python scripts. The Python uses the \'lxml\' package, and I\'ve found that I have to specify this ex

4条回答
  •  故里飘歌
    2021-02-09 22:37

    I have no experience with the combination of lxml and py2app specifically, but I've had issues with py2app not picking up modules that were not explicitly imported. For example, I had to explicitly include modules that are imported via __import__(), like this:

    OPTIONS['includes'] = [filename[:-3].replace('/', '.') for filename \
        in glob.glob('path/to/*.py')]
    

    Maybe it also helps in your case to insert an explicit from lxml import etree somewhere in your code?

提交回复
热议问题