Bundling data files with PyInstaller (--onefile)

前端 未结 13 1583
清歌不尽
清歌不尽 2020-11-21 13:28

I\'m trying to build a one-file EXE with PyInstaller which is to include an image and an icon. I cannot for the life of me get it to work with --onefile.

<
13条回答
  •  悲&欢浪女
    2020-11-21 14:07

    If you are still trying to put files relative to your executable instead of in the temp directory, you need to copy it yourself. This is how I ended up getting it done.

    https://stackoverflow.com/a/59415662/999943

    You add a step in the spec file that does a filesystem copy to the DISTPATH variable.

    Hope that helps.

提交回复
热议问题