Problem using py2app with the lxml package

后端 未结 4 878
迷失自我
迷失自我 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:29

    Found it. py2app has a 'frameworks' option to let you specify frameworks, and also dylibs. My setup.py file now looks like this:

    from setuptools import setup
    
    DATA_FILES = []
    OPTIONS = {'argv_emulation': True,
               'packages' : ['lxml'],
               'frameworks' : ['/usr/local/libxml2-2.7.2/lib/libxml2.2.7.2.dylib']
              }
    
    setup(app=MyApp.py,
          data_files=DATA_FILES,
          options={'py2app' : OPTIONS},
          setup_requires=['py2app'])
    

    and that's fixed it.

    Thanks for the suggestions that led me here.

提交回复
热议问题