ModuleNotFoundError: No module named 'bleach.css_sanitizer'

Hi all I am trying to set up the development env in my local using a tutor and when I am running tutor dev run lms openedx-assets build --env=dev its giving the below error,
Traceback of the error is:

Traceback (most recent call last):
  File "/openedx/bin/openedx-assets", line 218, in <module>
    main()
  File "/openedx/bin/openedx-assets", line 89, in main
    args.func(args)
  File "/openedx/bin/openedx-assets", line 93, in run_build
    run_xmodule(args)
  File "/openedx/bin/openedx-assets", line 108, in run_xmodule
    import xmodule.static_content
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/static_content.py", line 23, in <module>
    from xmodule.capa_module import ProblemBlock
  File "/openedx/edx-platform/common/lib/xmodule/xmodule/capa_module.py", line 29, in <module>
    from capa import responsetypes
  File "/openedx/edx-platform/common/lib/capa/capa/responsetypes.py", line 54, in <module>
    from .util import (
  File "/openedx/edx-platform/common/lib/capa/capa/util.py", line 16, in <module>
    from bleach.css_sanitizer import CSSSanitizer
ModuleNotFoundError: No module named 'bleach.css_sanitizer'

when I am running tutor dev start then also I am getting same error.

ps: I am using MacBook Air(m1 chip)

After debugging I got to know that the bleach version inside the docker container is 4.1.0, but whenever I am trying to install the all the requirements using tutor dev run lms pip install --requirement requirements/edx/development.txt command its installing the latest version which is 5.0.0 but when I am checking it after installation its again showing 4.1.0 version.

Can anybody tell me why this is happening & how to fix this?

When I am doing pip freeze then also bleach package is there but not sure why its giving the module not found error.
@regis can you please help me with this?

Iā€™m ready to bet my weight in peanut butter that:

  1. You are attempting to build the openedx Docker image with a custom fork of edx-platform.
  2. Your version of edx-platform is based off master, and not the latest release.
  3. You did not read this: Configuration and customisation ā€” Tutor documentation

Next time, please give as much details as possible.

1 Like