Skip to content

ImportError: No module named mitxgraders #346

@eazaika

Description

@eazaika

Hi,
I use mitxgraders in open edX, load this to Studio in Files of each course. All works fine many years, but now we gets import error sometimes:

2025-12-02 19:26:26,880 WARNING 12105 [codejail] safe_exec.py:248 - Using codejail/safe_exec.py:not_safe_exec for af3b88bbd53b4838bae5b78f59d4b176
2025-12-02 19:26:26,882 ERROR 12105 [capa.capa_problem] capa_problem.py:887 - Error while execing script code:
from mitxgraders import *
Traceback (most recent call last):
  File "/edx/app/edxapp/edx-platform/common/lib/capa/capa/capa_problem.py", line 884, in _extract_context
    unsafely=self.capa_system.can_execute_unsafe_code(),
  File "/edx/app/edxapp/edx-platform/common/lib/capa/capa/safe_exec/safe_exec.py", line 157, in safe_exec
    raise e
SafeExecException: ImportError: No module named mitxgraders
2025-12-02 19:26:26,882 ERROR 12105 [xmodule.x_module] x_module.py:1233 - Error creating xmodule
Traceback (most recent call last):
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1221, in _xmodule
    for_parent=self.get_parent() if self.has_cached_parent else None
  File "/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/runtime.py", line 638, in construct_xblock_from_class
    *args, **kwargs
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/capa_base.py", line 249, in __init__
    self.lcp = self.new_lcp(self.get_state_for_lcp())
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/capa_base.py", line 344, in new_lcp
    capa_module=self,  # njp
  File "/edx/app/edxapp/edx-platform/common/lib/capa/capa/capa_problem.py", line 194, in __init__
    self.context = self._extract_context(self.tree)
  File "/edx/app/edxapp/edx-platform/common/lib/capa/capa/capa_problem.py", line 889, in _extract_context
    raise responsetypes.LoncapaProblemError(msg)
Exception: cannot create LoncapaProblem block-v1:kafedra-inostrannyh-yazykov+ProfInYaz+fall_2025+type@problem+block@af3b88bbd53b4838bae5b78f59d4b176: Error while executing script code: ImportError: No module named mitxgraders

Mitxgraders files are alright. Reuploading this to course's files is not helping.
Restart lms process via supervisor helps.
Any ideas very appreciates

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions