No module named when using PyInstaller

Had a similar problem with no module named FileDialog. Discovered that with version 3.2, I could use

pyinstaller --hidden-import FileDialog ...

instead of modifying my main script.


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"],