What's the best way to use self-compiled Anki for normal study?

If I make custom patches to Anki (or build latest code from main), what’s the best way to use that during regular study?

The Development Guide says:

The ./run method described in the platform-specific instructions is a shortcut for starting Anki directly from the build folder. For regular study, it’s recommended you build Python wheels and then install them into your own python venv.

The generated wheels are in out/wheels. You can then install them by copying the paths into a pip install command. Follow the steps on the beta site, but …

Can I use uv to create and manage this python environment instead of pip? In either case, how to launch this version of Anki? Will I have to go to the terminal every time to launch it?

Can I selectively replace some files of my official Anki install so that it functions like the one created by pip in the above step?

Is there any other method that the regular Anki devs utilize to use their own dev builds for normal study?

I’ve not needed to try this yet, but once you’ve got the wheels built you should be able to reference them in the pyproject.toml ( Expand environment variables in URLs by charliermarsh · Pull Request #640 · astral-sh/uv · GitHub) and then sync project changes via the launcher

2 Likes

Thanks for the suggestion. I will try it.

What do you do, though? Do you just use ./run or do you use the pip method?

I only really fiddle with the ankidroid backend as i exclusively review on there :+1:

1 Like

I placed the wheels in the %LOCALAPPDATA%\AnkiProgramFiles\wheels directory and updated the pyproject.toml in AnkiProgramFiles to this:

[project]
name = "anki-launcher"
version = "1.0.0"
description = "UV-based launcher for Anki."
requires-python = ">=3.9"
dependencies = [
  "anki-release==25.09.2",
  "anki==25.09.2",
  "aqt==25.09.2",
]

[tool.uv.sources]
anki = { path = "wheels/anki-25.9.2-cp39-abi3-win_amd64.whl" }
aqt  = { path = "wheels/aqt-25.9.2-py3-none-any.whl" }

Then, clicked on Anki shortcut, chose Sync project changes in the launcher window that opened and it worked. Thank you!

I faced this issue in between: Failed to uninstall package due to missing `RECORD` file
I solved it by manually removing the problematic files from the \.venv\Lib\site-packages directory.

2 Likes