ImportError: Module import failed for Payment Request (erpnext.accounts.doctype.payment_request.payment_request Error: No module named '')

Hey Guys,

I am getting this error while installing of erpnext in ubuntu 20
ImportError: Module import failed for Payment Request (erpnext.accounts.doctype.payment_request.payment_request Error: No module named ‘’)



It may help to say which method you are using to install, and the command that produced the message.

Hey smino,

Thanks for response i am using this command bench --site erp install-app erpnext to install erpnext

Installing erpnext…
Updating DocTypes for erpnext : [ ] 1%An error occurred while installing erpnext: Module import failed for Payment Request (erpnext.accounts.doctype.payment_request.payment_request Error: No module named ‘’)
Traceback (most recent call last):
File “apps/frappe/frappe/modules/”, line 235, in load_doctype_module
doctype_python_modules[key] = frappe.get_module(module_name)
File “apps/frappe/frappe/”, line 1246, in get_module
return importlib.import_module(modulename)
File “/usr/lib/python3.8/importlib/”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 975, in _find_and_load_unlocked
File “”, line 671, in _load_unlocked
File “”, line 848, in exec_module
File “”, line 219, in _call_with_frames_removed
File “apps/erpnext/erpnext/accounts/doctype/payment_request/”, line 12, in
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry, get_company_defaults
File “apps/erpnext/erpnext/accounts/doctype/payment_entry/”, line 11, in
from erpnext.accounts.doctype.journal_entry.journal_entry import get_default_bank_cash_account
File “apps/erpnext/erpnext/accounts/doctype/journal_entry/”, line 8, in
from erpnext.controllers.accounts_controller import AccountsController
File “apps/erpnext/erpnext/controllers/”, line 12, in
from erpnext.buying.utils import update_last_purchase_rate
File “apps/erpnext/erpnext/buying/”, line 10, in
from erpnext.stock.doctype.item.item import get_last_purchase_details
File “apps/erpnext/erpnext/stock/doctype/item/”, line 13, in
from erpnext.setup.doctype.item_group.item_group import (get_parent_item_groups, invalidate_cache_for)
File “apps/erpnext/erpnext/setup/doctype/item_group/”, line 11, in
from import clear_cache
ModuleNotFoundError: No module named ‘’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “apps/frappe/frappe/commands/”, line 417, in install_app
_install_app(app, verbose=context.verbose)
File “apps/frappe/frappe/”, line 271, in install_app
sync_for(name, force=True, reset_permissions=True)
File “apps/frappe/frappe/model/”, line 95, in sync_for
File “apps/frappe/frappe/modules/”, line 145, in import_file_by_path
File “apps/frappe/frappe/modules/”, line 244, in import_doc
File “apps/frappe/frappe/model/”, line 273, in insert
File “apps/frappe/frappe/model/”, line 1060, in run_post_save_methods
File “apps/frappe/frappe/model/”, line 918, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “apps/frappe/frappe/model/”, line 1240, in composer
return composed(self, method, *args, **kwargs)
File “apps/frappe/frappe/model/”, line 1222, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “apps/frappe/frappe/model/”, line 915, in fn
return method_object(*args, **kwargs)
File “apps/frappe/frappe/core/doctype/doctype/”, line 390, in on_update
File “apps/frappe/frappe/core/doctype/doctype/”, line 465, in run_module_method
module = load_doctype_module(, self.module)
File “apps/frappe/frappe/modules/”, line 237, in load_doctype_module
raise ImportError(
ImportError: Module import failed for Payment Request (erpnext.accounts.doctype.payment_request.payment_request Error: No module named ‘’)

May we know the output of: bench version and the get-app command used to get frappe and erpnext?

Bench version is 5.8.1

frappe command which i used bench init frappe-bench --frappe-branch version-13

and for ERPNext bench get-app --branch version-13 erpnext

1 Like

I might try bench setup --requirements then bench update and try installing the app to the site again. Do you know if you are on develop or production?

I am trying to install on bench version 5.11.0. But the erpnext setup throws the same error. Any recommended solution.

I had the same error message then I installed erpNext version 14 … and the error was gone:

> bench get-app erpnext --branch version-14

1 Like