Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
@DeflatedPickle did you actually get this hook to work? I don't think it does with current versions of pyinstaller and pyfiglet. The package uses
So I think this depends on #2748 unless you provide the font parameter as a filename to avoid using pkg_resources - see below the relevant code for reference:
def preloadFont(cls, font): """ Load font data if exist """ for extension in ('tlf', 'flf'): fn = '%s.%s' % (font, extension) if pkg_resources.resource_exists('pyfiglet.fonts', fn): data = pkg_resources.resource_string('pyfiglet.fonts', fn) data = data.decode('UTF-8', 'replace') return data elif os.path.isfile(font): with open(font, 'rb') as f: return f.read().decode('UTF-8', 'replace') else: raise FontNotFound(font)
Was anyone able to get scripts using pyfiglet to work? I tried the above hook which didn't work and then tried updating my spec to include the font files as shown below:
It creates the executable but when I run it, I get the following:
I'm kind of surprised that this isn't working considering that a lot of scripts make use of pyfiglet. Thanks.
I'm having the same issue with pyfiglet, even with
@htgoebel Can you confirm that for this ticket to be solved it would take either:
I've found a workround that has worked for me and might work for other people too, so I'd like to share it. I've added the following as a PyInstaller hook (
This seems to have resolved the import issues, as expected, but raised the error
I've followed what has been discussed in #2748 and understood that the issue was now related to the fact that a runtime hook was registering the
In essence, instead of registering
Now, this works for me but I cannot guarantee this doesn't have side effects, use with caution please. Nonetheless, since it has worked for me and the issues haven't been fixed yet, I thought someone might have been interested in a workaround.
I have noticed this issue is dependent on #2748 , which is itself dependent on another issue. I'm not sure if this workaround helps in figuring out a way of solving any of those issues but if there's any approach you think could be taken, I don't mind trying to help.
I understand there is a different issue at hand here, but for anyone looking to quickly use pyfiglet with pyinstaller, doesn't this "just work" by adding a few things to the
Good luck on the issue everyone.