# ModuleNotFoundError: No module named 'speechd' on Anki installed in a venv

**URL:** <https://forums.ankiweb.net/t/modulenotfounderror-no-module-named-speechd-on-anki-installed-in-a-venv/28261>\
**Category:** Development\
**Created:** [March 8, 2023, 1:53am UTC](https://forums.ankiweb.net/t/modulenotfounderror-no-module-named-speechd-on-anki-installed-in-a-venv/28261 "2023-03-08T01:53:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sudomain](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@sudomain](https://forums.ankiweb.net/u/sudomain)\
**Post date:** [March 8, 2023, 1:53am UTC](https://forums.ankiweb.net/t/modulenotfounderror-no-module-named-speechd-on-anki-installed-in-a-venv/28261/1 "2023-03-08T01:53:28Z")

</div>

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/](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:

```auto
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'

```

---

<div class="post-metadata">

**Author:** ![abdo](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/abdo/32/654_2.png) [@abdo](https://forums.ankiweb.net/u/abdo)\
**Post date:** [March 8, 2023, 2:19am UTC](https://forums.ankiweb.net/t/modulenotfounderror-no-module-named-speechd-on-anki-installed-in-a-venv/28261/2 "2023-03-08T02:19:11Z")

</div>

Maybe a stupid question, but did you install speechd inside the venv?

---

<div class="post-metadata">

**Author:** ![sudomain](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@sudomain](https://forums.ankiweb.net/u/sudomain)\
**Post date:** [March 8, 2023, 10:24am UTC](https://forums.ankiweb.net/t/modulenotfounderror-no-module-named-speechd-on-anki-installed-in-a-venv/28261/3 "2023-03-08T10:24:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sudomain](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@sudomain](https://forums.ankiweb.net/u/sudomain)\
**Post date:** [March 8, 2023, 5:30pm UTC](https://forums.ankiweb.net/t/modulenotfounderror-no-module-named-speechd-on-anki-installed-in-a-venv/28261/4 "2023-03-08T17:30:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sudomain](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@sudomain](https://forums.ankiweb.net/u/sudomain)\
**Post date:** [March 14, 2023, 12:31pm UTC](https://forums.ankiweb.net/t/modulenotfounderror-no-module-named-speechd-on-anki-installed-in-a-venv/28261/5 "2023-03-14T12:31:49Z")

</div>

Sorry for the notifications, this is the last one. The best solution I found was to install the `apt install python3-speechd` package on Debian 11.6

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [April 13, 2023, 12:32pm UTC](https://forums.ankiweb.net/t/modulenotfounderror-no-module-named-speechd-on-anki-installed-in-a-venv/28261/6 "2023-04-13T12:32:16Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
