It seems the module does not yet support Python newer than 3.7 (3.9 in the latest version on Github), see https://github.com/ilius/pyglossary/tree/master/pyglossary/plugin_lib
Copying the folder pyglossary/plugin_lib/py37 to py310 and py311 fixes this build-error for me.