I have used PyInstaller only once before, and it worked pretty straight forward with wxPython. I\'m currently trying to build a different project though. The project works w
Pyinstaller sometimes needs explicit references in the .spec file to correctly package dependencies.
For more information, see ensuring proper import statements so that pyinstaller recognizes them.
For instance, it is very easy to miss crucial dependencies if they are imported from outside one of your Python modules (e.g. from a jar or c++ file which pyinstaller will not read).
dependency walker could be your first line of defense to systematically tracking missing DLLs. Simply download it and then load your exe or affiliated dlls to see which ones are missing dependencies. Then, it is just a wild goose chase tracking them down and manually adding them to your directory along with the .exe (assuming your packaging in one directory).
As a side note, for pyinstaller 2.1 (python 2.7.6), I modified the pyi_importers.py
file to at least try and print which module was the trouble maker when importing:
# line 409 of Pyinstaller.loader.pyi_importers.py
try: module = imp.load_module(fullname, fp, filename, self._c_ext_tuple)
except Exception as e:
print fullname # at least tells you what module couldn't be imported
raise e
Then, knowing where the issue occurred, you can then pin point the problem with dependency walker to root out the missing DLLs.
I know this answer doesn't answer how to debug issues like this, so I won't mark it as correct, but I managed to build the application and I thought I should share how. I did three things, each of which could be the cause of the error, but we'll never know: