Lms installation in frappe framework

bench get-app lms
I try to install lms in my site. I am getting this error.
how to solve and make that work
@shariquerik

bench --version 5.22.3
Frappe --version Frappe Framework: v15.x.x-develop () (develop)

bench --site learn.turiya.quest install-app lms

Installing lms…
An error occurred while installing lms: Module import failed for LMS Source, the DocType you’re trying to open might be deleted.
Error: No module named ‘frappe.core.doctype.lms_source’
Traceback with variables (most recent call last):
File “apps/frappe/frappe/commands/site.py”, line 496, in install_app
_install_app(app, verbose=context.verbose, force=force)
context = {‘sites’: [‘learn.turiya.quest’], ‘force’: False, ‘verbose’: False, ‘profile’: False}
apps = (‘lms’,)
force = False
_install_app = <function install_app at 0x72a72e439940>
filelock = <function filelock at 0x72a72e42ec00>
exit_code = 0
site = ‘learn.turiya.quest’
app = ‘lms’
err = ImportError(“Module import failed for LMS Source, the DocType you’re trying to open might be deleted.
Error: No module named ‘frappe.core.doctype.lms_source’”)
File “apps/frappe/frappe/installer.py”, line 324, in install_app
frappe.get_attr(after_install)()
name = ‘lms’
verbose = False
set_as_patched = True
force = False
sync_jobs = <function sync_jobs at 0x72a72d8267a0>
sync_for = <function sync_for at 0x72a72d8276a0>
sync_customizations = <function sync_customizations at 0x72a72e5dae80>
sync_fixtures = <function sync_fixtures at 0x72a72d827880>
app_hooks = {‘after_install’: [‘lms.install.after_install’], ‘after_sync’: [‘lms.install.after_sync’], ‘app_color’: [‘grey’], ‘app_description’: [‘Frappe LMS App’], ‘app_email’: [‘school@frappe.io’], ‘app_icon’: [‘octicon octicon-file-directory’], ‘app_license’: [‘AGPL’], ‘app_name’: [‘frappe_lms’], ‘app_publisher’: [‘Frappe’], ‘app_title’: [‘Frappe LMS’], ‘app_version’: [‘1.0.0’], ‘before_uninstall’: [‘lms.install.before_uninstall’], ‘doc_events’: {‘Discussion Reply’: {‘after_insert’: [‘lms.lms.utils.handle_notifications’]}}, ‘fixtures’: [‘Custom Field’, ‘Function’, ‘Industry’], ‘has_website_permission’: {‘LMS Certificate Evaluation’: [‘lms.lms.doctype.lms_certificate_evaluation.lms_certificate_evaluation.has_website_permission’], ‘LMS Certificate’: [‘lms.lms.doctype.lms_certificate.lms_certificate.has_website_permission’]}, ‘jinja’: {‘methods’: [‘lms.page_renderers.get_profile_url’, ‘lms.overrides.user.get_enrolled_courses’, ‘lms.overrides.user.get_course_membership’, 'lms.overrides.user.get_aut…
installed_apps = [‘frappe’]
after_install = ‘lms.install.after_install’
File “apps/lms/lms/install.py”, line 7, in after_install
create_batch_source()
File “apps/lms/lms/install.py”, line 194, in create_batch_source
doc = frappe.new_doc(“LMS Source”)
sources = [‘Newsletter’, ‘LinkedIn’, ‘Twitter’, ‘Website’, ‘Friend/Colleague/Connection’, ‘Google Search’]
source = ‘Newsletter’
File “apps/frappe/frappe/init.py”, line 1229, in new_doc
new_doc = get_new_doc(doctype, parent_doc, parentfield, as_dict=as_dict)
doctype = ‘LMS Source’
parent_doc = None
parentfield = None
as_dict = False
kwargs = {}
get_new_doc = <function get_new_doc at 0x72a720ade700>
File “apps/frappe/frappe/model/create_new.py”, line 22, in get_new_doc
frappe.local.new_doc_templates[doctype] = make_new_doc(doctype)
doctype = ‘LMS Source’
parent_doc = None
parentfield = None
as_dict = False
File “apps/frappe/frappe/model/create_new.py”, line 35, in make_new_doc
doc = frappe.get_doc({“doctype”: doctype, “__islocal”: 1, “owner”: frappe.session.user, “docstatus”: 0})
doctype = ‘LMS Source’
File “apps/frappe/frappe/init.py”, line 1373, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
args = ({‘doctype’: ‘LMS Source’, ‘__islocal’: 1, ‘owner’: ‘Administrator’, ‘docstatus’: 0},)
kwargs = {}
frappe = <module ‘frappe’ from ‘apps/frappe/frappe/init.py’>
File “apps/frappe/frappe/model/document.py”, line 85, in get_doc
controller = get_controller(doctype)
args = ({‘doctype’: ‘LMS Source’, ‘__islocal’: 1, ‘owner’: ‘Administrator’, ‘docstatus’: 0},)
kwargs = {‘doctype’: ‘LMS Source’, ‘__islocal’: 1, ‘owner’: ‘Administrator’, ‘docstatus’: 0}
doctype = ‘LMS Source’
File “apps/frappe/frappe/model/base_document.py”, line 71, in get_controller
site_controllers[doctype] = import_controller(doctype)
doctype = ‘LMS Source’
site_controllers = {‘Module Def’: <class ‘frappe.core.doctype.module_def.module_def.ModuleDef’>, ‘DocField’: <class ‘frappe.core.doctype.docfield.docfield.DocField’>, ‘DocPerm’: <class ‘frappe.core.doctype.docperm.docperm.DocPerm’>, ‘DocType Link’: <class ‘frappe.core.doctype.doctype_link.doctype_link.DocTypeLink’>, ‘System Settings’: <class ‘frappe.core.doctype.system_settings.system_settings.SystemSettings’>, ‘Notification Settings’: <class ‘frappe.desk.doctype.notification_settings.notification_settings.NotificationSettings’>, ‘DefaultValue’: <class ‘frappe.core.doctype.defaultvalue.defaultvalue.DefaultValue’>, ‘Customize Form’: <class ‘frappe.custom.doctype.customize_form.customize_form.CustomizeForm’>, ‘DocType Action’: <class ‘frappe.core.doctype.doctype_action.doctype_action.DocTypeAction’>, ‘DocType State’: <class ‘frappe.core.doctype.doctype_state.doctype_state.DocTypeState’>, ‘Customize Form Field’: <class ‘frappe.custom.doctype.customize_form_field.customize_form_field.CustomizeFormField’>, 'P…
File “apps/frappe/frappe/model/base_document.py”, line 91, in import_controller
module = load_doctype_module(doctype, module_name)
doctype = ‘LMS Source’
Document = <class ‘frappe.model.document.Document’>
NestedSet = <class ‘frappe.utils.nestedset.NestedSet’>
module_name = ‘Core’
doctype_info = None
module_path = None
class_overrides = {‘User’: [‘lms.overrides.user.CustomUser’], ‘Web Template’: [‘lms.overrides.web_template.CustomWebTemplate’]}
File “apps/frappe/frappe/modules/utils.py”, line 253, in load_doctype_module
raise ImportError(msg) from e
doctype = ‘LMS Source’
module = ‘Core’
prefix = ‘’
suffix = ‘’
app = ‘frappe’
key = ********
module_name = ‘frappe.core.doctype.lms_source.lms_source’
msg = “Module import failed for LMS Source, the DocType you’re trying to open might be deleted.
Error: No module named ‘frappe.core.doctype.lms_source’”
builtins.ImportError: Module import failed for LMS Source, the DocType you’re trying to open might be deleted.
Error: No module named ‘frappe.core.doctype.lms_source’

bench --site learn.turiya.quest uninstall-app lms --no-backup
bench remove-app lms --no-backup
bench get-app lms
bench --site learn.turiya.quest install-app lms

Try this

bench --site learn.turiya.quest uninstall-app lms --no-backup
bench remove-app lms --no-backup
@pateljannat

For third step (bench get-app lms)
i am getting this error

Getting lms
$ git clone lms --branch develop --depth 1 --origin upstream
fatal: repository 'lms' does not exist
ERROR: git clone lms --branch develop --depth 1 --origin upstream
subprocess.CalledProcessError: Command 'git clone lms --branch develop --depth 1 --origin upstream' returned non-zero exit status 128.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/bin/bench", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/usr/local/lib/python3.11/dist-packages/bench/cli.py", line 132, in cli
    bench_command()
  File "/usr/local/lib/python3.11/dist-packages/bench/commands/make.py", line 181, in get_app
    get_app(
  File "/usr/local/lib/python3.11/dist-packages/bench/app.py", line 765, in get_app
    app.get()
  File "/usr/local/lib/python3.11/dist-packages/bench/utils/render.py", line 126, in wrapper_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/bench/app.py", line 204, in get
    self.bench.run(
  File "/usr/local/lib/python3.11/dist-packages/bench/bench.py", line 48, in run
    return exec_cmd(cmd, cwd=cwd or self.cwd, _raise=_raise)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/bench/utils/__init__.py", line 169, in exec_cmd
    raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd)
bench.exceptions.CommandFailedError: git clone lms --branch develop --depth 1 --origin upstream

bench remove-app lms --no-backup
bench get-app --branch main GitHub - frappe/lms: Easy to Use, 100% Open Source Learning Management System

Try now

1 Like

Thankyou sir. It’s working

great
Mark it as solution

1 Like