Hi Julie,
Looking at the source for anyascii, it uses importlib.resources to grab those binaries, so I think it should be able to just grab them as you're trying to do (if it anyascii were just doing "open...read", that would probably result in some different strategy being needed).
In any case, when you run your pyinstaller command, have you noted that it produces a file "xxx.spec" (xxx is your exe name)? To make this easier (easiest?), start using that file instead of jamming a bunch of stuff on the command line.
First, make sure you have a good spec, assuming your old command line looked like:
$ pyinstaller xxx.py --a-bunch-of-stuff
you'll now use this in its place:
$ pyinstaller xxx.spec
as "xxx.spec" contains all the settings from the command line. Edit that file and look for "hiddenimports" in the "Analysis" block, I think that is the most likely candidate to solve this. Change it to something like
hiddenimports = ['anyascii._data.000', 'anyascii._data.001'],
and try the build, see if it coughs up any errors or reports that yes indeed it's including those data files. I'm sort of educated-guessing on the names listed there, but it should be something very close to that. If it works, then write some code in the .spec file that looks grossly like (yes, the is hacky, but it should give you the idea):
from glob import glob
from os.path import split
includes = []
for data_file in glob('wherever/they/live/anyascii/_data/*'):
dir, name = split(data_file)
if len(name) == 3: # <-- The super hacky part...
includes.append('anyascii._data.%s' % name)
then change that hiddenimports to
hiddenimports = includes,
Run "pyinstaller xxx.spec" and see if it works.
Eric