Pyfiglet, PyInstaller - compiling issues

Hey all. Relatively new to writing code, but here it goes:

I am writing a small, simple game to be played in the terminal window. Part of the game involves using pyfiglet’s fonts.

I’ve tried for many hours to get pyinstaller to compile it, however I’m always met with various errors. Namely, I believe the issue is pyinstaller not pulling the necessary information into the .exe and I get errors with all of the methods I’ve researched to date. I’m currently trying to compile with pyinstaller, using pycharm on a windows 10 laptop.

If I simply compile within pycharm using pyinstaller and then try to open the .exe by double clicking on it, a cmd window appears for a brief moment then disappears. When I go into a command terminal window and execute the program that way, I get the following:

Traceback (most recent call last):
  File "", line 50, in <module>
  File "", line 8, in intro
  File "pyfiglet\", line 65, in figlet_format
  File "pyfiglet\", line 794, in __init__
  File "pyfiglet\", line 801, in setFont
  File "pyfiglet\", line 126, in __init__
  File "pyfiglet\", line 147, in preloadFont
pyfiglet.FontNotFound: banner3-d
[988] Failed to execute script 'pyfiglet_compile' due to unhandled exception!

Python 3.11.1 is the version I have on this machine.

Any idea how I can successfully tell pyinstaller to include the needed fonts ?

At any rate, here’s some code I took off a youtube video that produces the same result - runs fine for me in pycharm, but when packaged with pyinstaller and double clicked, a black window appears briefly and disappears. The same errors above appear when running the .exe in a cmd window.

Below is code taken from a youtube video.

    import sys
    from pyfiglet import Figlet
    import random
    figlet = Figlet()
    if len(sys.argv) == 1:
        isRandomFont = True
    elif len(sys.argv[1] == "-f" or sys.argv[1] == "--font"):
        isRandomFont = False
    msg = input("Input: ")
    if isRandomFont == False:
            print("Invalid usage")
        font = random.choice(figlet.getFonts())

Below is the output when ran in a cmd window:

    Traceback (most recent call last):
      File "pkg_resources\", line 356, in get_provider
    KeyError: 'pyfiglet.fonts'
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "", line 5, in <module>
      File "pyfiglet\", line 794, in __init__
      File "pyfiglet\", line 801, in setFont
      File "pyfiglet\", line 126, in __init__
      File "pyfiglet\", line 136, in preloadFont
      File "pkg_resources\", line 1144, in resource_exists
      File "pkg_resources\", line 358, in get_provider
    ModuleNotFoundError: No module named 'pyfiglet.fonts'
    [27176] Failed to execute script '' due to unhandled 

Maybe related: No "pyfiglet.fonts" module found · Issue #95 · pwaller/pyfiglet · GitHub

My install is showing a pyfiglet/fonts folder containing a ton of fonts, including ones that I was using.