Issues With Pyinstaller And Reportlab
Alright so I have a python project that I want to compile, so I decided to use pyinstaller (first time compiling python). Now it compiled fine but when I run the exe it returns -1.
Solution 1:
Well I got it working,
Decided to go look at where exactly the AttributeError was being thrown from so I inspected the reportlab/rl_config.py
and reportlab/lib/utils.py
files and found that it was checking objects recursively looking for directories (as insinuated by rl_isdir
). Some how the FrozenImporter got stuck being checked with a list of other objects
so I replaced the line:
returnlen(list(filter(lambda x,pn=pn: x.startswith(pn),list(__loader__._files.keys()))))>0
with:
try:
returnlen(list(filter(lambda x,pn=pn: x.startswith(pn),list(__loader__._files.keys()))))>0except AttributeError:
returnFalse
This may not have been the cleanest most efficient way to resolve the issue but it only touches one line of the original code so I found this to be the most straight forward solution.
Post a Comment for "Issues With Pyinstaller And Reportlab"