How should add-ons install Python dependencies in 26.05?

I was using the api add-on helpers ( Add some helpers to allow add-ons to install packages into the venv · ankitects/anki@bb1b289 · GitHub ) to install spaCy and their models to be used with my add-on. However, these (unsurprisingly) stopped working in 26.05.

Is there a workaround for this?

You have to package any required modules with the add-on’s zip as was the case before the uv launcher: [Wiki] Bundling Python modules with add-ons

Yeah… no, that’s not going to work. The solution pre uv launcher was for users to manually create a virtual environment and install spacy and relevant models, which was way too cumbersome.

RIP AnkiMorphs.

Nothing prevents the add-on from bundling its own copy of pip/uv and using it for installing dependencies to some folder though?

Add-ons don’t choose the Python runtime they run in, so expecting each add-on to bundle and maintain its own package-management tooling is asking too much, imo. It’s not something I’m willing to do, at least.

For most add-ons, bundling dependencies at build time and modifying sys.path is enough (I have done that for dozens of add-ons), though that’s not practical for packages such as spacy.

It’s possible for Anki to bundle uv/pip with the new packaging tool, but dependencies have to be installed separately from Anki’s own dependencies, which are stored in a folder like site-packages but no full Python environment listing pinned dependencies, so we don’t get conflict resolution for free. Related: [Wiki] Bundling Python modules with add-ons - #4 by dae

I created an issue: Bundle uv/pip in Briefcase package? · Issue #5033 · ankitects/anki · GitHub