Python version mismatch with tutor

I have just pulled down all of the latest code from master/main for GitHub - openedx/openedx-platform: The Open edX LMS & Studio, powering education sites around the world! · GitHub, GitHub - openedx/openedx-core: Foundational Django models and APIs for a teaching and learning platform. · GitHub , and GitHub - openedx/frontend-app-learning: Front-end for the Open edX course experience, implemented using React and Paragon. · GitHub .

I also just upgraded my tutor version via pip install -U tutor which has put me on version 21.0.2. Per the log output, I also ran tutor config save.

However, when I run tutor build images openedx, I am getting the following error where it says it needs Python>=3.12 but it’s using Python 3.11.8. I can try to switch to installing tutor from Github instead of using pip, but I am curious if a fix for this is going to be released soon? Please let me know if I have misunderstood the issue here as well.

```

(venv) openedx@ip-10-48-12-12:~/repos$ tutor images build openedx
Adding /home/openedx/repos/openedx-platform to the build context 'edx-platform' of image 'openedx'
Adding /home/openedx/repos/openedx-core to the build context 'mnt-openedx-core' of image 'openedx'
Adding /home/openedx/repos/openedx-events to the build context 'mnt-openedx-events' of image 'openedx'
Building image docker.io/overhangio/openedx:21.0.2
docker buildx build --tag=docker.io/overhangio/openedx:21.0.2 --output=type=docker --cache-from=type=registry,ref=docker.io/overhangio/openedx:21.0.2-cache --build-context=edx-platform=/home/openedx/repos/openedx-platform --build-context=mnt-openedx-core=/home/openedx/repos/openedx-core --build-context=mnt-openedx-events=/home/openedx/repos/openedx-events /home/openedx/.local/share/tutor/env/build/openedx
[+] Building 164.4s (37/76)                                                                                                                                                    docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                     0.0s
 => => transferring dockerfile: 13.15kB                                                                                                                                                  0.0s
 => resolve image config for docker-image://docker.io/docker/dockerfile:1                                                                                                                0.3s
 => CACHED docker-image://docker.io/docker/dockerfile:1@sha256:4a43a54dd1fedceb30ba47e76cfcf2b47304f4161c0caeac2db1c61804ea3c91                                                          0.0s
 => [internal] load metadata for docker.io/powerman/dockerize:0.19.0                                                                                                                     0.3s
 => [internal] load metadata for ghcr.io/astral-sh/uv:0.9.18                                                                                                                             0.4s
 => [internal] load metadata for docker.io/library/ubuntu:22.04                                                                                                                          0.3s
 => [context edx-platform] load .dockerignore                                                                                                                                            0.1s
 => => transferring edx-platform: 2.75kB                                                                                                                                                 0.0s
 => [context mnt-openedx-events] load .dockerignore                                                                                                                                      0.1s
 => => transferring mnt-openedx-events: 2B                                                                                                                                               0.0s
 => [context mnt-openedx-core] load .dockerignore                                                                                                                                        0.1s
 => => transferring mnt-openedx-core: 2B                                                                                                                                                 0.0s
 => [internal] load .dockerignore                                                                                                                                                        0.0s
 => => transferring context: 2B                                                                                                                                                          0.0s
 => importing cache manifest from docker.io/overhangio/openedx:21.0.2-cache                                                                                                              0.6s
 => => inferred cache manifest type: application/vnd.oci.image.manifest.v1+json                                                                                                          0.0s
 => [internal] load build context                                                                                                                                                        0.1s
 => => transferring context: 3.33kB                                                                                                                                                      0.0s
 => [context mnt-openedx-events] load from client                                                                                                                                        0.2s
 => => transferring mnt-openedx-events: 2.81MB                                                                                                                                           0.1s
 => [context mnt-openedx-core] load from client                                                                                                                                          0.4s
 => => transferring mnt-openedx-core: 5.48MB                                                                                                                                             0.3s
 => [context edx-platform] load from client                                                                                                                                              7.0s
 => => transferring edx-platform: 108.66MB                                                                                                                                               6.9s
 => FROM docker.io/powerman/dockerize:0.19.0@sha256:a34158d699e065609fc845e7cdc1e070f185afdbca317fe4931aaea04818f8bf                                                                     0.8s
 => => resolve docker.io/powerman/dockerize:0.19.0@sha256:a34158d699e065609fc845e7cdc1e070f185afdbca317fe4931aaea04818f8bf                                                               0.0s
 => => sha256:12b06425c45a6d7463503262c570d5dbb81cfe86ae70dd1863c85494b1bdf910 673B / 673B                                                                                               0.0s
 => => sha256:6c1212d719ed15a070ce1e261a3e6582ad8d48a5f3f6df89aae23cbbd32a35c9 1.81kB / 1.81kB                                                                                           0.0s
 => => sha256:63b65145d645c1250c391b2d16ebe53b3747c295ca8ba2fcb6b0cf064a4dc21c 3.37MB / 3.37MB                                                                                           0.3s
 => => sha256:a7677d492efd73c4dd27bfa501f534016e39c6bdaf2bbbb6e0988f19b0928b1f 2.94MB / 2.94MB                                                                                           0.3s
 => => sha256:a34158d699e065609fc845e7cdc1e070f185afdbca317fe4931aaea04818f8bf 5.41kB / 5.41kB                                                                                           0.0s
 => => extracting sha256:63b65145d645c1250c391b2d16ebe53b3747c295ca8ba2fcb6b0cf064a4dc21c                                                                                                0.2s
 => => extracting sha256:a7677d492efd73c4dd27bfa501f534016e39c6bdaf2bbbb6e0988f19b0928b1f                                                                                                0.1s
 => FROM ghcr.io/astral-sh/uv:0.9.18@sha256:5713fa8217f92b80223bc83aac7db36ec80a84437dbc0d04bbc659cae030d8c9                                                                             0.0s
 => [minimal 1/3] FROM docker.io/library/ubuntu:22.04@sha256:ce4a593b4e323dcc3dd728e397e0a866a1bf516a1b7c31d6aa06991baec4f2e0                                                            0.0s
 => CACHED [minimal 2/3] RUN --mount=type=cache,target=/var/cache/apt,sharing=locked     --mount=type=cache,target=/var/lib/apt,sharing=locked     apt update &&     apt install -y bui  0.0s
 => CACHED [minimal 3/3] COPY --from=ghcr.io/astral-sh/uv:0.9.18 /uv /usr/local/bin/uv                                                                                                   0.0s
 => CACHED [python 1/4] RUN --mount=type=cache,target=/var/cache/apt,sharing=locked     --mount=type=cache,target=/var/lib/apt,sharing=locked     apt update &&     apt install -y libs  0.0s
 => CACHED [python 2/4] RUN git clone https://github.com/pyenv/pyenv /opt/pyenv --branch v2.3.36 --depth 1                                                                               0.0s
 => [production  1/41] RUN --mount=type=cache,target=/var/cache/apt,sharing=locked     --mount=type=cache,target=/var/lib/apt,sharing=locked     apt update     && apt install -y gett  44.3s
 => [python 3/4] RUN /opt/pyenv/bin/pyenv install 3.11.8                                                                                                                               117.5s
 => [production  2/41] RUN if [ "1000" = 0 ]; then echo "app user may not be root" && false; fi                                                                                          0.3s
 => [production  3/41] RUN useradd --no-log-init --home-dir /openedx --create-home --shell /bin/bash --uid 1000 app                                                                      0.3s
 => [production  4/41] COPY --link --from=docker.io/powerman/dockerize:0.19.0 /usr/local/bin/dockerize /usr/local/bin/dockerize                                                          0.1s
 => [production  5/41] COPY --link --chown=1000:1000 --from=edx-platform / /openedx/edx-platform                                                                                         2.1s
 => [python 4/4] RUN /opt/pyenv/versions/3.11.8/bin/python -m venv /openedx/venv                                                                                                         5.5s
 => [nodejs-requirements 1/4] RUN uv pip install nodeenv==1.9.1                                                                                                                          0.5s
 => [python-requirements 1/6] RUN --mount=type=cache,target=/var/cache/apt,sharing=locked     --mount=type=cache,target=/var/lib/apt,sharing=locked     apt update     && apt install   36.0s
 => [nodejs-requirements 2/4] RUN nodeenv /openedx/nodeenv --node=24.12.0 --prebuilt                                                                                                     8.5s
 => [production  6/41] COPY --link --chown=1000:1000 --from=python /opt/pyenv /opt/pyenv                                                                                                 3.9s
 => [nodejs-requirements 3/4] WORKDIR /openedx/edx-platform                                                                                                                              0.1s
 => [nodejs-requirements 4/4] RUN --mount=type=bind,from=edx-platform,source=/package.json,target=/openedx/edx-platform/package.json     --mount=type=bind,from=edx-platform,source=/p  26.9s
 => [python-requirements 2/6] RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared     uv pip install     setuptools==69.1.1 pip==24.0 wheel==0.43.0                         0.6s
 => ERROR [python-requirements 3/6] RUN --mount=type=bind,from=edx-platform,source=/requirements/edx/base.txt,target=/openedx/edx-platform/requirements/edx/base.txt     --mount=type=b  0.7s
------
 > [python-requirements 3/6] RUN --mount=type=bind,from=edx-platform,source=/requirements/edx/base.txt,target=/openedx/edx-platform/requirements/edx/base.txt     --mount=type=bind,from=edx-p
latform,source=/requirements/edx/assets.txt,target=/openedx/edx-platform/requirements/edx/assets.txt     --mount=type=cache,target=/openedx/.cache/pip,sharing=shared     uv pip install -r /o
penedx/edx-platform/requirements/edx/base.txt -r /openedx/edx-platform/requirements/edx/assets.txt:
0.428 Using Python 3.11.8 environment at: /openedx/venv
0.579   × No solution found when resolving dependencies:
0.579   ╰─▶ Because the current Python version (3.11.8) does not satisfy
0.579       Python>=3.12 and code-annotations==3.0.0 depends on Python>=3.12, we can
0.579       conclude that code-annotations==3.0.0 cannot be used.
0.579       And because you require code-annotations==3.0.0, we can conclude that
0.579       your requirements are unsatisfiable.
------
Dockerfile:98
--------------------
  97 |     # Install base requirements and asset-building requirements
  98 | >>> RUN --mount=type=bind,from=edx-platform,source=/requirements/edx/base.txt,target=/openedx/edx-platform/requirements/edx/base.txt \
  99 | >>>     --mount=type=bind,from=edx-platform,source=/requirements/edx/assets.txt,target=/openedx/edx-platform/requirements/edx/assets.txt \
 100 | >>>     --mount=type=cache,target=/openedx/.cache/pip,sharing=shared \
 101 | >>>     $PIP_COMMAND install -r /openedx/edx-platform/requirements/edx/base.txt -r /openedx/edx-platform/requirements/edx/assets.txt
 102 |
--------------------
ERROR: failed to solve: process "/bin/sh -c $PIP_COMMAND install -r /openedx/edx-platform/requirements/edx/base.txt -r /openedx/edx-platform/requirements/edx/assets.txt" did not complete successfully: exit code: 1
Error: Command failed with status 1: docker buildx build --tag=docker.io/overhangio/openedx:21.0.2 --output=type=docker --cache-from=type=registry,ref=docker.io/overhangio/openedx:21.0.2-cache --build-context=edx-platform=/home/openedx/repos/openedx-platform --build-context=mnt-openedx-core=/home/openedx/repos/openedx-core --build-context=mnt-openedx-events=/home/openedx/repos/openedx-events /home/openedx/.local/share/tutor/env/build/openedx

Hey Mary, for developing on Open edX master branches, you should always use Tutor Main, which can only be installed from the git source: Running Open edX on the master branch (“Tutor Main”) — Tutor documentation. The PyPI-published versions of Tutor only work with the named Open edX releases.

2 Likes

Thank you - I can confirm that these steps solved my issue:

pip uninstall -y tutor
pip install -U setuptools wheel
python -m pip install -e "tutor[full] @ git+https://github.com/overhangio/tutor.git@main"
tutor --version
tutor config save
tutor images build --no-cache openedx