ImportError: No module named mitxgraders

Hi,
I use mitxgraders in open edX (ironwood native), 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

P.S.: gets some extra error but seems like not important:

2025-12-02 19:26:26,975 ERROR 12105 [edx.courseware] views.py:594 - Error in /courses/course-v1:kafedra-inostrannyh-yazykov+ProfInYaz+fall_2025/courseware/37cf123553054a9aa156da049261bfac/1296c3e3ff604af9b12a18556783b2fa/3: user=black04bsidian150412, effective_user=black04bsidian150412, course=course-v1:kafedra-inostrannyh-yazykov+ProfInYaz+fall_2025
Traceback (most recent call last):
  File "/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/views/index.py", line 155, in get
    return self.render(request)
  File "/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/views/index.py", line 219, in render
    return render_to_response('courseware/courseware.html', self._create_courseware_context(request))
  File "/edx/app/edxapp/edx-platform/lms/djangoapps/courseware/views/index.py", line 478, in _create_courseware_context
    courseware_context['fragment'] = self.section.render(self.view, section_context)
  File "/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/core.py", line 203, in render
    return self.runtime.render(self, view, context)
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1921, in render
    return self.__getattr__('render')(block, view_name, context)
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1342, in render
    return super(MetricsMixin, self).render(block, view_name, context=context)
  File "/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/runtime.py", line 833, in render
    frag = view_fn(context)
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/seq_module.py", line 310, in student_view
    return self._student_or_public_view(context, prereq_met, prereq_meta_info, banner_text)
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/seq_module.py", line 391, in _student_or_public_view
    items = self._render_student_view_for_items(context, display_items, fragment, view) if prereq_met else []
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/seq_module.py", line 533, in _render_student_view_for_items
    rendered_item = item.render(view, context)
  File "/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/core.py", line 203, in render
    return self.runtime.render(self, view, context)
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1921, in render
    return self.__getattr__('render')(block, view_name, context)
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1342, in render
    return super(MetricsMixin, self).render(block, view_name, context=context)
  File "/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/runtime.py", line 833, in render
    frag = view_fn(context)
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/vertical_block.py", line 127, in student_view
    return self._student_or_public_view(context, STUDENT_VIEW)
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/vertical_block.py", line 94, in _student_or_public_view
    rendered_child = child.render(view, child_block_context)
  File "/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/core.py", line 203, in render
    return self.runtime.render(self, view, context)
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1921, in render
    return self.__getattr__('render')(block, view_name, context)
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1342, in render
    return super(MetricsMixin, self).render(block, view_name, context=context)
  File "/edx/app/edxapp/venvs/edxapp/src/xblock/xblock/runtime.py", line 837, in render
    updated_frag = self.wrap_xblock(block, view_name, frag, context)
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/x_module.py", line 1294, in wrap_xblock
    frag = wrapper(block, view, frag, context)
  File "/edx/app/edxapp/edx-platform/openedx/core/lib/xblock_utils/__init__.py", line 157, in wrap_xblock
    add_webpack_to_fragment(frag, class_name)
  File "/edx/app/edxapp/edx-platform/common/lib/xmodule/xmodule/util/xmodule_django.py", line 28, in add_webpack_to_fragment
    for chunk in webpack_loader.utils.get_files(bundle_name, extension, config):
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/webpack_loader/utils.py", line 31, in get_files
    return list(_get_bundle(bundle_name, extension, config))
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/webpack_loader/utils.py", line 23, in _get_bundle
    bundle = get_loader(config).get_bundle(bundle_name)
  File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/webpack_loader/loader.py", line 83, in get_bundle
    raise WebpackBundleLookupError('Cannot resolve bundle {0}.'.format(bundle_name))
WebpackBundleLookupError: Cannot resolve bundle NonStaffErrorModule.

Hi @eazaika - Ironwood is from March 2019, and is no longer supported. My best guess is that the code has changed and that package has been removed upstream. @pdpinch may have more insight.

@eazaika, if it helps, that package lives at GitHub - mitodl/mitx-grading-library: The MITx Grading Library, a python grading library for edX, and you use it with the python_lib.zip file inside the courses, as you mentioned. If it worked before and you didn’t make changes in the files or the openedx version, you shouldn’t have different behavior. Still, if you upgrade openedx or change to a different python_lib.zip, it could cause problems (for example, the latest version of that package drops support for Python 2).

Some resources:
Changelog: Changelog - MITxGraders
If you want to download a specific python_lib.zip depending on the version: Releases · mitodl/mitx-grading-library · GitHub (in the assets, you have the python_lib.zip)