How to fix error “ModuleNotFoundError: No module named 'safe_lxml’”

I am experiencing an issue while trying to run Open edX for development on my Ubuntu 22.04.3 LTS laptop. I am using Python version 3.8.10.

Here are the steps I followed to run Open edX:

Step 1: I installed the latest version of Tutor using the command pip install "tutor[full]" (current version is 16.1.1).

Step 2: I created a docker-compose.override.yml file at "$(tutor config printroot)/env/dev/docker-compose.override.yml" to bind-mount volumes. The directory I bind-mounted is from a project I cloned from the GitHub edx-platform repository, and I check out to the open-release/ginkgo.master branch.

Step 3: I ran the command tutor dev launch. After this command completed, I encountered an error saying ModuleNotFoundError: No module named 'safe_lxml' in some containers, specifically lms, lms-worker, cms, and cms-worker.

I attempted to access the bash of the lms container and install safe_lxml using the command pip install -e common/lib/safe_lxml, but encountered another error is error: could not create 'safe_lxml.egg-info': Permission denied

did you use

tutor images build openedx-dev

before using

tutor dev launch

Please refer Open edX development — Tutor documentation

Thanks for answering. I deleted all the old containers and images and ran the command tutor images build openedx-dev before tutor dev launch . However, I am still getting the error ModuleNotFoundError: No module named ‘safe_lxml’.

You are trying to run the Ginkgo version of Open edX with Tutor v16. This is not going to work. Tutor was never compatible with Ginkgo. The first version of Open edX that Tutor was compatible with was Hawthorn; that was five years ago and I strongly suggest you do not attempt to run that old version.

I suggest you either run the native installation or upgrade your platform to Palm.