Addon Creation bug

Hello everyone. I’ve recently joined the Anki community. Lately, I’ve been working on a personal addon. Everything was going well until I tried importing some libraries like spacy and nltk. When I opened Anki, I encountered an error message saying “No module named ‘spacy’,” even though I had previously installed these libraries using pip install. Does anyone familiar with this issue know how to resolve it?Thanks

This is the error notification screen.
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 ‘⁨demo⁩’:
⁨Traceback (most recent call last):
File “aqt.addons”, line 247, in loadAddons
File “C:\Users\Admin\AppData\Roaming\Anki2\addons21\”, line 7, in
import nltk
ModuleNotFoundError: No module named ‘spacy’

You have to copy the necessary libraries to your add-on folder and add them to Python’s module search path to be able to import them. Please see Add support for dependencies in addons - #3 by abdo

1 Like