I have been following this tutorial by Karani on installing a custom app on a running ERPNext instance installed via Docker: Installing A Custom App On Your Running ERPNext Instance Installed via Docker - Code with Karani
But when I try to install the app on my site (this part of the video: https://youtu.be/BsV9ZB4Aqew?t=370) I get this error:
frappe@eebf260dc785:~/frappe-bench$ bench --site kiambu install-app healthcare
App erpnext already installedInstalling healthcare…
An error occurred while installing healthcare: Module import failed for Medical Department, the DocType you’re trying to open might be deleted.
Error: No module named ‘frappe.core.doctype.medical_department’
Traceback with variables (most recent call last):
File “apps/frappe/frappe/commands/site.py”, line 444, in install_app
_install_app(app, verbose=context.verbose, force=force)
context = {‘sites’: [‘kiambu’], ‘force’: False, ‘verbose’: False, ‘profile’: False}
apps = (‘healthcare’,)
force = False
_install_app = <function install_app at 0x7f2de2815a80>
filelock = <function filelock at 0x7f2de2806ca0>
exit_code = 0
site = ‘kiambu’
app = ‘healthcare’
err = ImportError(“Module import failed for Medical Department, the DocType you’re trying to open might be deleted.
Error: No module named ‘frappe.core.doctype.medical_department’”)
File “apps/frappe/frappe/installer.py”, line 311, in install_app
frappe.get_attr(after_install)()
name = ‘healthcare’
verbose = False
set_as_patched = True
force = False
sync_jobs = <function sync_jobs at 0x7f2de12bd3a0>
sync_for = <function sync_for at 0x7f2de12be3e0>
sync_customizations = <function sync_customizations at 0x7f2de27af600>
sync_fixtures = <function sync_fixtures at 0x7f2de12be5c0>
app_hooks = {‘after_install’: [‘healthcare.setup.setup_healthcare’], ‘after_uninstall’: [‘healthcare.uninstall.after_uninstall’], ‘app_color’: [‘grey’], ‘app_description’: [‘Modern, Open Source HIS built on Frappe and ERPNext’], ‘app_email’: [‘info@earthianslive.com’], ‘app_icon’: [‘octicon octicon-file-directory’], ‘app_include_js’: [‘healthcare.bundle.js’], ‘app_license’: [‘GNU GPL V3’], ‘app_name’: [‘healthcare’], ‘app_publisher’: [‘earthians Health Informatics Pvt. Ltd.’], ‘app_title’: [‘Frappe Health’], ‘app_version’: [‘15.0.0’], ‘auto_cancel_exempted_doctypes’: [‘Inpatient Medication Entry’], ‘before_tests’: [‘healthcare.healthcare.utils.before_tests’], ‘before_uninstall’: [‘healthcare.uninstall.before_uninstall’], ‘doc_events’: {‘*’: {‘on_submit’: [‘healthcare.healthcare.doctype.patient_history_settings.patient_history_settings.create_medical_record’], ‘on_cancel’: [‘healthcare.healthcare.doctype.patient_history_settings.patient_history_settings.delete_medical_record’], 'on_update_after_sub…
installed_apps = [‘frappe’, ‘erpnext’]
app = ‘erpnext’
required_app = ‘erpnext’
after_install = ‘healthcare.setup.setup_healthcare’
File “apps/healthcare/healthcare/setup.py”, line 144, in setup_healthcare
create_custom_records()
abdm_setup = <function setup at 0x7f2ddf08b2e0>
File “apps/healthcare/healthcare/setup.py”, line 198, in create_custom_records
create_medical_departments()
File “apps/healthcare/healthcare/setup.py”, line 238, in create_medical_departments
mediacal_department = frappe.new_doc(“Medical Department”)
departments = [‘Accident And Emergency Care’, ‘Anaesthetics’, ‘Biochemistry’, ‘Cardiology’, ‘Diabetology’, ‘Dermatology’, ‘Diagnostic Imaging’, ‘ENT’, ‘Gastroenterology’, ‘General Surgery’, ‘Gynaecology’, ‘Haematology’, ‘Maternity’, ‘Microbiology’, ‘Nephrology’, ‘Neurology’, ‘Oncology’, ‘Orthopaedics’, ‘Pathology’, ‘Physiotherapy’, ‘Rheumatology’, ‘Serology’, ‘Urology’]
department = ‘Accident And Emergency Care’
File “apps/frappe/frappe/init.py”, line 1143, in new_doc
new_doc = get_new_doc(doctype, parent_doc, parentfield, as_dict=as_dict)
doctype = ‘Medical Department’
parent_doc = None
parentfield = None
as_dict = False
kwargs = {}
get_new_doc = <function get_new_doc at 0x7f2ddf5216c0>
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 = ‘Medical Department’
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 = ‘Medical Department’
File “apps/frappe/frappe/init.py”, line 1286, in get_doc
doc = frappe.model.document.get_doc(*args, **kwargs)
args = ({‘doctype’: ‘Medical Department’, ‘__islocal’: 1, ‘owner’: ‘Administrator’, ‘docstatus’: 0},)
kwargs = {}
frappe = <module ‘frappe’ from ‘apps/frappe/frappe/init.py’>
File “apps/frappe/frappe/model/document.py”, line 83, in get_doc
controller = get_controller(doctype)
args = ({‘doctype’: ‘Medical Department’, ‘__islocal’: 1, ‘owner’: ‘Administrator’, ‘docstatus’: 0},)
kwargs = {‘doctype’: ‘Medical Department’, ‘__islocal’: 1, ‘owner’: ‘Administrator’, ‘docstatus’: 0}
doctype = ‘Medical Department’
File “apps/frappe/frappe/model/base_document.py”, line 70, in get_controller
site_controllers[doctype] = import_controller(doctype)
doctype = ‘Medical Department’
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’>, ‘Payment Reconciliation’: <class ‘erpnext.accounts.doctype.payment_reconciliation.payment_reconciliation.PaymentReconciliation’>, ‘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.DocTyp…
File “apps/frappe/frappe/model/base_document.py”, line 95, in import_controller
module = load_doctype_module(doctype, module_name)
doctype = ‘Medical Department’
Document = <class ‘frappe.model.document.Document’>
NestedSet = <class ‘frappe.utils.nestedset.NestedSet’>
module_name = ‘Core’
doctype_info = None
module_path = None
class_overrides = {‘Address’: [‘erpnext.accounts.custom.address.ERPNextAddress’], ‘Sales Invoice’: [‘healthcare.healthcare.custom_doctype.sales_invoice.HealthcareSalesInvoice’]}
File “apps/frappe/frappe/modules/utils.py”, line 241, in load_doctype_module
raise ImportError(msg) from e
doctype = ‘Medical Department’
module = ‘Core’
prefix = ‘’
suffix = ‘’
app = ‘frappe’
key = ********
module_name = ‘frappe.core.doctype.medical_department.medical_department’
msg = “Module import failed for Medical Department, the DocType you’re trying to open might be deleted.
Error: No module named ‘frappe.core.doctype.medical_department’”
builtins.ImportError: Module import failed for Medical Department, the DocType you’re trying to open might be deleted.
Error: No module named ‘frappe.core.doctype.medical_department’
How can I resolve this issue?