I’m attempting to add another voice to the add-on “HyperTTS”, however I’m running into this error. I think the problem is with my install of Anki: I installed it in a venv using the instructions for Linux (ARM) at https://betas.ankiweb.net/, though I removed --pre so that I have the stable version of Anki and not a beta. I can import speechd successfully when I’m outside of the venv, but when inside the venv I get ModuleNotFoundError: No module named 'speechd'
Full log:
Error
An add-on you installed failed to load. If problems persist, please go to the Tools>Add-ons menu, and disable or delete the add-on.
When loading '??HyperTTS - Add speech to your flashcards??':
??Traceback (most recent call last):
File "/home/anki-user/pyenv/lib/python3.9/site-packages/aqt/addons.py", line 247, in loadAddons
__import__(addon.dir_name)
File "/sdcard/Anki/addons21/111623432/__init__.py", line 134, in <module>
service_manager.init_services()
File "/sdcard/Anki/addons21/111623432/servicemanager.py", line 87, in init_services
self.import_services()
File "/sdcard/Anki/addons21/111623432/servicemanager.py", line 96, in import_services
__import__(self.package_name, globals(), locals(), [module_name], sys._addon_import_level_base)
File "/sdcard/Anki/addons21/111623432/services/service_speechd.py", line 6, in <module>
import speechd
ModuleNotFoundError: No module named 'speechd'
I didn’t, figuring it was included with my installed packages when --system-site-packages was included. However it seems it’s not a pypi/pip package because I also can’t install it with pyenv/bin/pip install speechd. It must be a module that came with the speechd package installed via apt, but I can’t get the venv to see it.
Sorry if this is something trivial. This is my first time wrangling a venv outside of a tutorial.
I found the root of the problem and a very flimsy solution.
The problem: The speech-dispatcher package on Debian installs the speechd python module in the site packages as expected. It does this only in the Python 3.11 site packages. Anki and the venv that it is installed in is using the Python 3.9 site packages, which doesn’t contain the speechd module.
My bad solution: copy the 3.11 speechd site package into the venv site packages. I can’t tell yet if I can actually use the module for the add-on in this way, but at least it’s no longer giving the ModuleNotFoundError.
It technically works but could break and I’d appreciate ideas for a more stable solution