Getting error when installing ERPNext 13.x in Ubuntu 22.04 LTS

By following the steps given here by D-codE I managed to install Frappe and also install ERPNext 14 beta. And this is working just great.

Then I started to install ERPNext 13.x.

I used the following commands:

bench init frappe-bench13
cd frappe-bench13/
bench start 

I opened a new window of Terminal and give following commands:

bench new-site erp13
bench use erp13
bench get-app --branch version-13
bench --site erp13 install-app erpnext

On issuing the last command it is throwing up error. Here is the error dump.

Installing erpnext...

Updating DocTypes for erpnext       : [                    ] 0%An error occurred while installing erpnext: Module import failed for Journal Entry, the DocType you're trying to open might be deleted.<br> Error: No module named ''

Traceback (most recent call last):

  File "apps/frappe/frappe/modules/", line 240, in load_doctype_module

    doctype_python_modules[key] = frappe.get_module(module_name)

  File "apps/frappe/frappe/", line 1286, in get_module

    return importlib.import_module(modulename)

  File "/usr/lib/python3.10/importlib/", line 126, in import_module

    return _bootstrap._gcd_import(name[level:], package, level)

  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import

  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load

  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked

  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked

  File "<frozen importlib._bootstrap_external>", line 883, in exec_module

  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed

  File "apps/erpnext/erpnext/accounts/doctype/journal_entry/", line 14, in <module>

    from erpnext.accounts.doctype.invoice_discounting.invoice_discounting import (

  File "apps/erpnext/erpnext/accounts/doctype/invoice_discounting/", line 16, in <module>

    from erpnext.controllers.accounts_controller import AccountsController

  File "apps/erpnext/erpnext/controllers/", line 30, in <module>

    from erpnext.accounts.doctype.pricing_rule.utils import (

  File "apps/erpnext/erpnext/accounts/doctype/pricing_rule/", line 14, in <module>

    from erpnext.setup.doctype.item_group.item_group import get_child_item_groups

  File "apps/erpnext/erpnext/setup/doctype/item_group/", line 11, in <module>

    from import clear_cache

ModuleNotFoundError: No module named ''

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

Traceback (most recent call last):

  File "apps/frappe/frappe/commands/", line 414, in install_app

    _install_app(app, verbose=context.verbose, force=force)

  File "apps/frappe/frappe/", line 278, in install_app

    sync_for(name, force=force, reset_permissions=True)

  File "apps/frappe/frappe/model/", line 80, in sync_for


  File "apps/frappe/frappe/modules/", line 145, in import_file_by_path


  File "apps/frappe/frappe/modules/", line 242, in import_doc


  File "apps/frappe/frappe/model/", line 278, in insert


  File "apps/frappe/frappe/model/", line 1084, in run_post_save_methods


  File "apps/frappe/frappe/model/", line 925, in run_method

    out = Document.hook(fn)(self, *args, **kwargs)

  File "apps/frappe/frappe/model/", line 1263, in composer

    return composed(self, method, *args, **kwargs)

  File "apps/frappe/frappe/model/", line 1245, in runner

    add_to_return_value(self, fn(self, *args, **kwargs))

  File "apps/frappe/frappe/model/", line 922, in fn

    return method_object(*args, **kwargs)

  File "apps/frappe/frappe/core/doctype/doctype/", line 408, in on_update


  File "apps/frappe/frappe/core/doctype/doctype/", line 494, in run_module_method

    module = load_doctype_module(, self.module)

  File "apps/frappe/frappe/modules/", line 244, in load_doctype_module

    raise ImportError(msg) from e

ImportError: Module import failed for Journal Entry, the DocType you're trying to open might be deleted.<br> Error: No module named ''

Bench version command gives this output

erpnext 13.35.0
frappe 14.x.x-develop

What must be the problem and how to solve it?


You have to reinstall bench init with

bench init --frappe-branch version-13 frappe-bench13

or the frappe version install is the develop once.
Frappe version and ERPNext version have to be the same

1 Like

Thanks for the command. I managed to solve this problem yesterday after a bit of RnD.

Here is what worked for me
bench init --frappe-branch13 --version version-13


Yogesh, could you help me in this regard? I had the same struggle like you and your thread helped me already.
But now I want to use erpnext stable version 13 in production mode. Do you know how to do this at the end of D-Codes instructions?
Thank you very much in advance!


I have setup ERPNext for Development, but here are the steps that you may be able to use.