# Python 3.11/3.12 upgrade for Tutor and its plugins

**URL:** <https://discuss.openedx.org/t/python-3-11-3-12-upgrade-for-tutor-and-its-plugins/12323>\
**Category:** Development\
**Tags:** tutor\
**Created:** [February 13, 2024, 5:33pm UTC](https://discuss.openedx.org/t/python-3-11-3-12-upgrade-for-tutor-and-its-plugins/12323 "2024-02-13T17:33:34Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![kmccormick](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/kmccormick/32/8982_2.png) [@kmccormick](https://discuss.openedx.org/u/kmccormick)\
**Post date:** [February 13, 2024, 5:33pm UTC](https://discuss.openedx.org/t/python-3-11-3-12-upgrade-for-tutor-and-its-plugins/12323/1 "2024-02-13T17:33:34Z")

</div>

The Redwood 🌲 release, which is cut early April and release early June, will include the upgrade of Open edX services from Python 3.8 to 3.12. As those upgrades begin happening upstream, let’s use this thread to coordinate upgrading Tutor and its plugins’ Dockerfiles to installing Python 3.12.

Rather than switching to 3.12 all at once for Tutor v18 in June, I think we should switch over core and plugins on the Nightly branches as soon as possible. That way, Tutor Nightly users can begin running and testing 3.12 ahead of Redwood release.

The last time a big Open edX Python upgrade happened was [3.5 → 3.8 in Koa](https://github.com/overhangio/tutor/commit/728ef966dc572d37cf76f08c112277a5111b0d6b). At that time there were fewer plugins and no such thing as Tutor Nightly, so we are trodding a new path 😄

[@tutor-maintainers](https://discuss.openedx.org/groups/tutor-maintainers), could you all confirm that:

1. If your plugin runs a Python service: you’ll keep an eye on that service’s Python upgrade process, so that you can switch your plugin’s Nightly branch over to installing Python 3.12 as soon as it’s ready.
2. Separately, for every plugin: the actual Python code in your plugin is compatible with 3.12.

---

<div class="post-metadata">

**Author:** ![feoh](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/feoh/32/4865_2.png) [@feoh](https://discuss.openedx.org/u/feoh)\
**Post date:** [February 20, 2024, 5:39pm UTC](https://discuss.openedx.org/t/python-3-11-3-12-upgrade-for-tutor-and-its-plugins/12323/2 "2024-02-20T17:39:50Z")

</div>

Just wondering - will this include the ancilliary components like the Tubular pipeline for user retirement? That’s currently running Python 3.8.

---

<div class="post-metadata">

**Author:** ![Syed\_Muhammad\_Dawoud](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/syed_muhammad_dawoud/32/6313_2.png) [@Syed\_Muhammad\_Dawoud](https://discuss.openedx.org/u/Syed_Muhammad_Dawoud)\
**Post date:** [February 21, 2024, 10:57am UTC](https://discuss.openedx.org/t/python-3-11-3-12-upgrade-for-tutor-and-its-plugins/12323/3 "2024-02-21T10:57:24Z")

</div>

Hi. For tutor codebase Python 3.12 upgrade, the issues have been created in various repositories. We are tracking the overall progress on [Python 3.12 upgrade · Issue #1004 · overhangio/tutor · GitHub](https://github.com/overhangio/tutor/issues/1004). We might use the same issue to track Tutor compatibility with 3.12 versions for Open edX services (once upgraded). For now, our focus is to make the Tutor codebase compatible with Python 3.12.

---

<div class="post-metadata">

**Author:** ![kmccormick](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/kmccormick/32/8982_2.png) [@kmccormick](https://discuss.openedx.org/u/kmccormick)\
**Post date:** [February 22, 2024, 4:01pm UTC](https://discuss.openedx.org/t/python-3-11-3-12-upgrade-for-tutor-and-its-plugins/12323/4 "2024-02-22T16:01:50Z")

</div>

We’ve just moved the user retirement code from tubular to edx-platform, so the edx-platform Python 3.12 upgrade will take care of that bit: [Move user retirement scripts code from the tubular repo by farhan · Pull Request #34063 · openedx/edx-platform · GitHub](https://github.com/openedx/edx-platform/pull/34063)

Do you know of any other parts of tubular or other openedx repos that Tutor relies on?

---

<div class="post-metadata">

**Author:** ![feoh](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/feoh/32/4865_2.png) [@feoh](https://discuss.openedx.org/u/feoh)\
**Post date:** [February 22, 2024, 5:15pm UTC](https://discuss.openedx.org/t/python-3-11-3-12-upgrade-for-tutor-and-its-plugins/12323/5 "2024-02-22T17:15:38Z")

</div>

I honestly know very little about Tutor as we don’t really use it meaningfully at MIT unless the devs are using it.

Thanks for the heads-up. We implemented some local tubular changes at MIT so we’ll need to figure out how to handle this. (ISTR it’s around letting tubular consume environment variables for its required secrets.

---

<div class="post-metadata">

**Author:** ![feanil](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/feanil/32/37_2.png) [@feanil](https://discuss.openedx.org/u/feanil)\
**Post date:** [March 7, 2024, 8:21pm UTC](https://discuss.openedx.org/t/python-3-11-3-12-upgrade-for-tutor-and-its-plugins/12323/6 "2024-03-07T20:21:33Z")

</div>

The Python 3.12 update has landed on the edx-notes-api repo, any tutor updates that need to happen to make that the default for the edx-notes-api plguin should be made.

Relevant PR on the app side: [Add support for Python 3.12 by irtazaakram · Pull Request #392 · openedx/edx-notes-api · GitHub](https://github.com/openedx/edx-notes-api/pull/392)

---

<div class="post-metadata">

**Author:** ![kmccormick](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/kmccormick/32/8982_2.png) [@kmccormick](https://discuss.openedx.org/u/kmccormick)\
**Post date:** [March 18, 2024, 3:08pm UTC](https://discuss.openedx.org/t/python-3-11-3-12-upgrade-for-tutor-and-its-plugins/12323/7 "2024-03-18T15:08:29Z")

</div>

@jhony_avella , as tutor-notes maintainer, could you confirm that you’ll soon upgrade the plugin to install Python 3.12 in its Dockerfile?

---

<div class="post-metadata">

**Author:** ![jhony\_avella](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/jhony_avella/32/710_2.png) [@jhony\_avella](https://discuss.openedx.org/u/jhony_avella)\
**Post date:** [March 19, 2024, 3:11pm UTC](https://discuss.openedx.org/t/python-3-11-3-12-upgrade-for-tutor-and-its-plugins/12323/8 "2024-03-19T15:11:17Z")

</div>

@kmccormick the updates are on my plate. Due to a very tight schedule, I plan to start with this effort next Monday, April 1. Is it OK?

---

<div class="post-metadata">

**Author:** ![kmccormick](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/kmccormick/32/8982_2.png) [@kmccormick](https://discuss.openedx.org/u/kmccormick)\
**Post date:** [March 19, 2024, 3:29pm UTC](https://discuss.openedx.org/t/python-3-11-3-12-upgrade-for-tutor-and-its-plugins/12323/9 "2024-03-19T15:29:01Z")

</div>

Sounds good, thanks @jhony_avella !

---

<div class="post-metadata">

**Author:** ![kmccormick](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/kmccormick/32/8982_2.png) [@kmccormick](https://discuss.openedx.org/u/kmccormick)\
**Post date:** [March 21, 2024, 2:21pm UTC](https://discuss.openedx.org/t/python-3-11-3-12-upgrade-for-tutor-and-its-plugins/12323/10 "2024-03-21T14:21:31Z")

</div>

UPDATE: For Redwood, edx-platform will be upgraded to Python 3.11, not Python 3.12. In Sumac, we’d go to 3.12.

All other services are still aiming for Python 3.12 in Redwood.

---

<div class="post-metadata">

**Author:** ![regis](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/regis/32/2640_2.png) [@regis](https://discuss.openedx.org/u/regis)\
**Post date:** [March 22, 2024, 9:17am UTC](https://discuss.openedx.org/t/python-3-11-3-12-upgrade-for-tutor-and-its-plugins/12323/11 "2024-03-22T09:17:39Z")

</div>

@kmccormick for my own education, what’s the reason behind this decision? Are there too many breaking changes in 3.12? Or are there too many dependencies that don’t work on 3.12?

---

<div class="post-metadata">

**Author:** ![chintan](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/chintan/32/52_2.png) [@chintan](https://discuss.openedx.org/u/chintan)\
**Post date:** [March 28, 2024, 1:45pm UTC](https://discuss.openedx.org/t/python-3-11-3-12-upgrade-for-tutor-and-its-plugins/12323/12 "2024-03-28T13:45:09Z")

</div>

While Kyle and Feanil will have more detailed answer, from what I know, there are some libraries that aren’t working on 3.12 and 3.8 like `numpy` and `scipy` which are present in various repos, so we need 3.11.

---

<div class="post-metadata">

**Author:** ![kmccormick](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/kmccormick/32/8982_2.png) [@kmccormick](https://discuss.openedx.org/u/kmccormick)\
**Post date:** [March 28, 2024, 1:58pm UTC](https://discuss.openedx.org/t/python-3-11-3-12-upgrade-for-tutor-and-its-plugins/12323/13 "2024-03-28T13:58:21Z")

</div>

@feanil Do you know the exact reason?

---

<div class="post-metadata">

**Author:** ![feanil](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/feanil/32/37_2.png) [@feanil](https://discuss.openedx.org/u/feanil)\
**Post date:** [April 3, 2024, 8:25pm UTC](https://discuss.openedx.org/t/python-3-11-3-12-upgrade-for-tutor-and-its-plugins/12323/14 "2024-04-03T20:25:00Z")

</div>

The reason that edx-platform is going to 3.11 and not 3.12 is because it depends on Numpy/SciPy and there is not a version that is compatible with Both 3.11 and 3.8. Once we get to 3.11 we can update the two packages further and be able to go to 3.12 for Sumac.

For edx-platform dependencies, where possible we should be aiming to test on both 3.11 and 3.12 today and identify any other places what that’s not possible today.

---

<div class="post-metadata">

**Author:** ![feanil](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/feanil/32/37_2.png) [@feanil](https://discuss.openedx.org/u/feanil)\
**Post date:** [April 29, 2024, 7:18pm UTC](https://discuss.openedx.org/t/python-3-11-3-12-upgrade-for-tutor-and-its-plugins/12323/15 "2024-04-29T19:18:57Z")

</div>

The Python 3.12 upgrade has landed on the Xqueue service: [Jhony/add python 312 support by jfavellar90 · Pull Request #932 · openedx/xqueue · GitHub](https://github.com/openedx/xqueue/pull/932)

Please update tutor to start using python 3.12 for this service.

---

<div class="post-metadata">

**Author:** ![feanil](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/feanil/32/37_2.png) [@feanil](https://discuss.openedx.org/u/feanil)\
**Post date:** [May 2, 2024, 12:52pm UTC](https://discuss.openedx.org/t/python-3-11-3-12-upgrade-for-tutor-and-its-plugins/12323/16 "2024-05-02T12:52:58Z")

</div>

The Python 3.11 upgrade has landed for edx-platform: [feanil/test on 3.11 by feanil · Pull Request #34374 · openedx/edx-platform · GitHub](https://github.com/openedx/edx-platform/pull/34374)

Also informed here: [Tutor Python 3.11 upgrade · Issue #1006 · overhangio/tutor · GitHub](https://github.com/overhangio/tutor/issues/1006#issuecomment-2090427517)

Please update tutor to start using Python 3.11 for this service.

---

<div class="post-metadata">

**Author:** ![feanil](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/feanil/32/37_2.png) [@feanil](https://discuss.openedx.org/u/feanil)\
**Post date:** [May 9, 2024, 4:07pm UTC](https://discuss.openedx.org/t/python-3-11-3-12-upgrade-for-tutor-and-its-plugins/12323/17 "2024-05-09T16:07:41Z")

</div>

The Python 3.11 upgrade has landed in the credentials service: [build: adding python3.11 support. by awais786 · Pull Request #2389 · openedx/credentials · GitHub](https://github.com/openedx/credentials/pull/2389)

Please update tutor to start using Python 3.11 for this service.
