Pyinstaller on a setuptools package

前端 未结 5 1665
既然无缘
既然无缘 2021-01-11 09:33

I\'m attempting to run PyInstaller on a CLI app I am building in Python using the Click library. I\'m having trouble building the project using PyInstaller. PyInstaller has

5条回答
  •  离开以前
    2021-01-11 10:28

    Something I've noticed is that the typical way of adding a data file doesn't work once you've monkey patched Entrypoint in the way Scott Crooks recommends in the ticked answer. For me, I had to append to the a.datas array. In python3, this looks like:

    ...
    a = Entrypoint(...)
    from pathlib import Path
    Path('/tmp/modulename/datafile.txt').write_text(Path('datafile.txt').read_text()))
    a.datas.append('datafile.txt', '/tmp/modulename/datafile.txt', 'DATA')
    
    pyz = PYZ(...)
    ...
    

提交回复
热议问题