# Upgrading to Python 3.10

**URL:** <https://forums.ankiweb.net/t/upgrading-to-python-3-10/61208>\
**Category:** Development\
**Created:** [May 19, 2025, 10:29am UTC](https://forums.ankiweb.net/t/upgrading-to-python-3-10/61208 "2025-05-19T10:29:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrewsanchez](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/andrewsanchez/32/10294_2.png) [@andrewsanchez](https://forums.ankiweb.net/u/andrewsanchez)\
**Post date:** [May 19, 2025, 10:29am UTC](https://forums.ankiweb.net/t/upgrading-to-python-3-10/61208/1 "2025-05-19T10:29:27Z")

</div>

As @dae noted in [ankitects/anki#3081](https://github.com/ankitects/anki/issues/3081) and discussed [here](https://forums.ankiweb.net/t/how-often-does-the-internal-python-version-get-updated/37444/2) Anki is stuck on `3.9.18`.

However, PyOxidizer supports up to `3.10`. Can we at least upgrade to `3.10`? The [fork of Pyoxidizer that Anki references](https://github.com/ankitects/anki/blob/31d877f20d602fca8fd8da89a165e349c7a3e30b/.gitmodules#L9-L13) is `111 commits behind indygreg/PyOxidizer:main.`

I’m asking because there are some libraries that require at least `3.10` that I’d like to vendor with an add-on. 🥺

---

<div class="post-metadata">

**Author:** ![andrewsanchez](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/andrewsanchez/32/10294_2.png) [@andrewsanchez](https://forums.ankiweb.net/u/andrewsanchez)\
**Post date:** [May 20, 2025, 6:14am UTC](https://forums.ankiweb.net/t/upgrading-to-python-3-10/61208/2 "2025-05-20T06:14:52Z")

</div>

Is the “correct” way to build Anki locally with a specific Python version to specify the `PYTHON_BINARY` env var that is used [here](https://github.com/ankitects/anki/blob/31d877f20d602fca8fd8da89a165e349c7a3e30b/build/ninja_gen/src/python.rs#L59-L60)? E.g., `PYTHON_BINARY=/opt/homebrew/Caskroom/miniconda/base/envs/anki/bin/python ./run`. I was surprised to find that `./run` doesn’t seem to care about the `python` version in `PATH`.

---

<div class="post-metadata">

**Author:** ![Shigeyuki](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/shigeyuki/32/23878_2.png) [@Shigeyuki](https://forums.ankiweb.net/u/Shigeyuki)\
**Post date:** [May 21, 2025, 12:03pm UTC](https://forums.ankiweb.net/t/upgrading-to-python-3-10/61208/3 "2025-05-21T12:03:43Z")

</div>

Though it’s just an idea, in case of add-ons development and the module is not compatible with the Python version of Anki, it seems to me that it would be better to develop another small app to communicate like Anki Connect (I created a small app with PyInstaller to restart Anki with my add-on AnkiRestart, about 6MB each). The disadvantage of this approach is that if the app is not paid code-signed it will be rejected by VirusBuster (especially Mac), but Ankihub has professional developers so maybe this is not a problem.

---

<div class="post-metadata">

**Author:** ![andrewsanchez](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/andrewsanchez/32/10294_2.png) [@andrewsanchez](https://forums.ankiweb.net/u/andrewsanchez)\
**Post date:** [May 21, 2025, 1:31pm UTC](https://forums.ankiweb.net/t/upgrading-to-python-3-10/61208/4 "2025-05-21T13:31:40Z")

</div>

The downside to that is that the app wouldn’t have access to everything a normal add-on does (probably doesn’t matter for lots of use cases, but still). Also, [Python 3.9 is reaching end of life this year](https://devguide.python.org/versions/), so I think t needs to be upgraded anyway.

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [May 22, 2025, 2:31pm UTC](https://forums.ankiweb.net/t/upgrading-to-python-3-10/61208/5 "2025-05-22T14:31:16Z")

</div>

To clarify my comment on [Upgrade python by andrewsanchez · Pull Request #4023 · ankitects/anki · GitHub](https://github.com/ankitects/anki/pull/4023#issuecomment-2900977253), we should be able to upgrade to 3.10 by using an older python-build-standalone release, but probably won’t be able to use the newer astral ones.

---

<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:** [June 21, 2025, 2:32pm UTC](https://forums.ankiweb.net/t/upgrading-to-python-3-10/61208/6 "2025-06-21T14:32:02Z")

</div>

Closed on June 21, 2025, 2:32pm UTC

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