No module named when using PyInstaller

后端 未结 7 1945
说谎
说谎 2020-11-27 15:11

I try to compile a Python project under Windows 7 using PyInstaller. The project works fine, there are no issues, however when I try to compile it the result doesn\'t work.

7条回答
  •  死守一世寂寞
    2020-11-27 16:02

    Pyinstaller won't see second level imports. So if you import module A, pyinstaller sees this. But any additional module that is imported in A will not be seen.

    There is no need to change anything in your python scripts. You can directly add the missing imports to the spec file. Just change the following line:

    hiddenimports=[],
    

    to

    hiddenimports=["Tkinter", "FileDialog"],
    

提交回复
热议问题