Hello, I’m developing an Anki add-on that relies on the google-auth
and google-auth-oauthlib
Python libraries. I’m facing issues with Anki finding these libraries, even after following these steps:
- Installing Directly into Anki’s ‘lib’ Folder: I’ve used Anki’s associated
pip
to install the libraries directly into Anki’s mainlib
directory (e.g.,C:\Program Files\Anki\lib
). - Dynamic Importing: I’ve tried dynamically loading the modules from within my add-on’s
lib
folder usingimportlib.util
.
Despite these attempts, I’m still encountering “ModuleNotFoundError” errors. Here’s an example error:
ModuleNotFoundError: No module named 'google.auth'
- Anki appears to strongly isolate its Python environment, preventing my add-on from accessing the required libraries.
- This behavior persists even when using standard import mechanisms and installing the libraries into Anki’s core directory.
- Is there a recommended Anki-specific way to package Python dependencies with add-ons?
- Are there configuration options or techniques to influence how Anki searches for add-on modules?
- I’ve scoured Anki’s documentation but haven’t found definitive guidance on add-on dependency management.
- Any insights or suggestions from experienced Anki developers would be greatly appreciated!