Unable to package program with xmldiff as exe
vadefac opened this issue · comments
Hi, I have tried to package my program as an exe with both pyinstaller and Nuitka. They successfully create the executable but when I try to run it, the program fails at the xmldiff import with the following error.
File "\gat.dist\gat.py", line 9, in
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 668, in load_unlocked
File "", line 638, in load_backward_compatible
File "\gat.dist\xmldiff\main.py", line 9, in
File "\gat.dist\pkg_resources_init.py", line 892, in require
File "\gat.dist\pkg_resources_init.py", line 778, in resolve
pkg_resources.DistributionNotFound: The 'xmldiff' distribution was not found and is required by the application
I can confirm that this does not work, and neither does cx_freeze, however, I don't think that's a bug with xmldiff. I've tried to found information about the errors I get from the various tools, but I can't find anything. I think you need to talk to pyinstaller people to figure out what it going on.
This bug is due to the way xmldiff uses pkg_resources in main.py. There's nothing wrong with it, but pyinstaller is unable to handle things that like. It's no big deal, a simple hook file for pyinstaller will handle it. I submitted the PR, they should accept soon enough hopefully.
For now, if you simply make this py file and include a --additional-hooks-dir= flag you can create exes.
@ItsCinnabar @regebro yes this is a hook problem. Unfortunately we can't offer support for this, but will accept PRs with a fix. (Edit:I'm a PyInstaller team member)
This has been merged, I'm assuming it's now fixed.