PyInstaller, spec file, ImportError: No module named 'blah'

前端 未结 3 1868
走了就别回头了
走了就别回头了 2020-12-01 09:43

I am trying to build a python script via PyInstaller. I have used the following commands to configure, generate a spec file, and build:

wget pyinstaller.zip         


        
3条回答
  •  执笔经年
    2020-12-01 10:12

    This error can ocurre when you have dynamic imports in your code. In that case, pyinstaller don't include those packages in exe file. In that case you can:

    1. Add unused import of those packages in your code
    2. Tell pyinstaller to include it

    One file option does not change anything in running your code. If you create --onefile exe all files created by pyinstaller are packed to exe file, and unpacked to local temp every time you run exe.

提交回复
热议问题