ModuleNotFoundError: No module named '_sass' when building Open edX with Tutor

Help Request: ModuleNotFoundError: No module named ‘_sass’ when building Open edX with Tutor

I’ve been struggling to set up an Open edX instance using Tutor and consistently encounter the following error during image building:

ModuleNotFoundError: No module named ‘_sass’

Dockerfile:212

210 | # will be processed. This makes the docker image lighter and faster to build.
211 | RUN npm run postinstall # Postinstall artifacts are stuck in nodejs-requirements layer. Create them here too.
212 | >>> RUN npm run compile-sass – --skip-themes
213 | RUN npm run webpack

214
ERROR: failed to solve: process “/bin/sh -c npm run compile-sass – --skip-themes” did not complete successfully: exit code: 1

What I’ve tried so far:

  • Used both Tutor 19.0.0 and 19.0.2 versions
  • Switched from Python 3.10 to Python 3.11
  • Deleted and recreated the virtual environment
  • Completely wiped and re-cloned the edx-platform repository
  • Cleaned Docker cache and removed all containers before rebuilding
  • Ran tutor config save to create fresh configuration
  • Ran tutor build --no-cache to avoid caching issues
  • Installed libsass via pip (pip install libsass)
  • Tried installing sass globally (npm install -g sass)

I’ve seen references to node-sass compatibility issues in Stack Overflow and the Open edX forums, with suggestions to update the node-sass version in package.json, but nothing has worked so far.

When running tutor dev launch or any tutor build command, I consistently hit this error. My goal is to eventually mount my local edx-platform directory to Tutor for customization, but I can’t even get past the initial build.

Has anyone encountered this specific issue with Tutor 19.x and found a working solution? Any guidance would be greatly appreciated!

Additional environment details:

Thank you in advance for any help!


Feel free to fill in the additional environment details at the bottom with your specific system information before posting.

Hey @leo98ber , I think we talked in Slack. Do you mind explaining here how you resolved your problem, so that others could use that information if they hit the same problem?

@leo98ber I would also be interested in seeing what you did to resolve this please! It looks like there was a similar issue here: Build image for openedx-dev fail - #7 by Syed_Muhammad_Dawoud that also never got answered on the forums.

1 Like

I believe this was due to a mismatch between the poster’s Tutor version and their edx-platform repo version. In particular, older versions of edx-platform installed sass through requirements/edx/base.txt., whereas newer versions of edx-platform install _sass through a separate requirements/edx/assets.txt (in order to slim down the base image build). Newer Tutor versions account for this by installing assets.txt before compiling Sass, whereas older versions don’t.

When mounting a local edx-platform repository, one should use Tutor Main if their branch is close to edx-platform master, and they should they should use the corresponding compatible Tutor numbered release if their branch is closed to an edx-platform named release.

@tonybusa let me know if that doesn’t resolve this for you.

1 Like

That makes sense. I am having trouble figuring out how to switch between Tutor Main and a Tutor numbered release.

Perhaps because I installed tutor NOT behind a virtual environment originally. So now even when I do install it WITHIN a virtual environment it still shows a versioned number:

(.venv) tony.busa tutor % git branch
* main
(.venv) tony.busa edx-platform % tutor --version
tutor, version 19.0.2

Next steps would be to:

  1. uninstall tutor from my machine completely
  2. start venv
  3. install tutor (main branch): git clone --branch=main GitHub - overhangio/tutor: The Docker-based Open edX distribution designed for peace of mind
    pip install -e “./tutor[full]”
  4. try running building openedx (master branch, I was previously using the sumac release branch)

It seems the issue may be my lack of segregating my virtual environments for each version of tutor and edx-platform.

Let me know if you think I’m on the right track please and thank you!

My steps above did work but I also purged my docker environment:

  • deleted the containers
  • deleted the images
  • deleted the volumes

I was able to get past my step but now me and another engineer on my team are experiencing this failure when building the “mfe”:

ERROR: failed to solve: process "/bin/sh -c npm install @edly-io/indigo-frontend-component-footer@^2.0.0" did not complete successfully: exit code: 1

Error: Command failed with status 1: docker buildx build --tag=docker.io/overhangio/openedx-mfe:19.0.0-main-indigo --no-cache --output=type=docker --cache-from=type=registry,ref=docker.io/overhangio/openedx-mfe:19.0.0-main-indigo-cache /Users/tony.busa/Library/Application Support/tutor-main/env/plugins/mfe/build/mfe
tutor plugins list

NAME       	STATUS   	VERSION
android    	installed	19.0.0
cairn      	installed	19.0.4
credentials	installed	19.0.0
discovery  	installed	19.0.0
forum      	installed	19.0.0
indigo     	✅ enabled	19.0.1
jupyter    	installed	19.0.0
mfe        	✅ enabled	19.0.0
minio      	installed	19.0.1
notes      	installed	19.0.2
webui      	installed	19.0.0
xqueue     	installed	19.0.2

Any thoughts?

UPDATE:

@Daniel Wong found a resolution to change this file (underlined):

Then went to submit an issue but saw one was already created: Tutor-mfe main branch image build failure due to mismatched peer dependencies · Issue #142 · overhangio/tutor-indigo · GitHub

Purged my docker environment again, then “tutor dev launch” completed successfully. However, I did need to “tutor dev stop”, “tutor dev start” for the site to load properly.

hi @tonybusa , thank you it works for me. But I have a new issue when running tutor dev launch. Do you know why I got this?

ERROR: failed to solve: executor failed running [/bin/sh -c npm clean-install --no-audit --no-fund --registry=$NPM_REGISTRY]: exit

Hi @wowothk ! I’m not sure but it looks like there was another thread on the forums that mentions your error: [Tutor] Fails when build mfe images

I find it helpful to share versions for node, npm, etc. to give more context on what could’ve caused the error.