Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Hook for 'phonenumbers.data.' #3381
works when invoked directly using Python 3.6.4:
but when packaged with pyinstaller 3.4.dev0:
fails, ultimately with:
which the phonenumbers package appears to try to load dynamically. It's in:
That directory contains an "init.py" along with more than 300 other (small) modules which "phonenumbers" loads as needed.
Is there some magic to make this work with "--onedir", but ideally with "--onefile"? To give the script another place to look for those modules? To incorporate them into the .EXE? Since I'm fairly new to Python and totally new to pyinstaller, I don't doubt I'm overlooking something. The recipe for pytz seems to hold some promise, but I can't be sure and I'm not yet knowledgeable enough to work with it.
When I try to attach pyinstaller's run log or the executable's, I'm being told "we can't process that file", so I'm pasting them here. First the executable's run log:
And pyinstaller's run log:
I assume for full functionality you need to add all these 300 hidden modules. For this create a hook using
We would appreciate if you'd submit a pull-request for the hook for this then :-) See our Development Guide on how to create pull-requests for PyInstaller. Thanks.
changed the title from
Packaged script fails on dynamic load; minimal example
Hook for 'phonenumbers.data.'
Mar 13, 2018
added a commit
Jun 11, 2018
context : I'm using snap-plugin-lib-py, my goal is to get rand.py workable in non python environment. So I'm trying pyinstaller.
Why is this import error, shouldn't it import all the required packages?
Here is the pyinstaller run log.
pyinstaller --onefile rand.py