ImportError: No module named address.address

Hi Everyone,

While creating bench new-site I came across this error log, Need help on this.

Installing frappe...
Updating frappe                     : [========================================]
Traceback (most recent call last):
  File "/usr/lib/python2.7/", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/", line 72, in _run_code
    exec code in run_globals
  File "/home/asabbas/frappe-bench/apps/frappe/frappe/utils/", line 79, in <module>
  File "/home/asabbas/frappe-bench/apps/frappe/frappe/utils/", line 16, in main
  File "/home/asabbas/frappe-bench/env/local/lib/python2.7/site-packages/click/", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/asabbas/frappe-bench/env/local/lib/python2.7/site-packages/click/", line 696, in main
    rv = self.invoke(ctx)
  File "/home/asabbas/frappe-bench/env/local/lib/python2.7/site-packages/click/", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/asabbas/frappe-bench/env/local/lib/python2.7/site-packages/click/", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/asabbas/frappe-bench/env/local/lib/python2.7/site-packages/click/", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/asabbas/frappe-bench/env/local/lib/python2.7/site-packages/click/", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/asabbas/frappe-bench/apps/frappe/frappe/", line 69, in new_site
    _new_site(db_name, site, mariadb_root_username=mariadb_root_username, mariadb_root_password=mariadb_root_password, admin_password=admin_password, verbose=verbose, install_apps=install_app, source_sql=source_sql, force=force)
  File "/home/asabbas/frappe-bench/apps/frappe/frappe/", line 89, in _new_site
    _install_app("frappe", verbose=verbose, set_as_patched=not source_sql)
  File "/home/asabbas/frappe-bench/apps/frappe/frappe/", line 124, in install_app
  File "/home/asabbas/frappe-bench/apps/frappe/frappe/", line 143, in add_to_installed_apps
  File "/home/asabbas/frappe-bench/apps/frappe/frappe/", line 189, in post_install
  File "/home/asabbas/frappe-bench/apps/frappe/frappe/", line 210, in init_singles
  File "/home/asabbas/frappe-bench/apps/frappe/frappe/model/", line 230, in save
  File "/home/asabbas/frappe-bench/apps/frappe/frappe/model/", line 183, in insert
  File "/home/asabbas/frappe-bench/apps/frappe/frappe/model/", line 390, in _set_defaults
    new_doc = frappe.new_doc(df.options, as_dict=True)
  File "/home/asabbas/frappe-bench/apps/frappe/frappe/", line 501, in new_doc
    return get_new_doc(doctype, parent_doc, parentfield, as_dict=as_dict)
  File "/home/asabbas/frappe-bench/apps/frappe/frappe/model/", line 19, in get_new_doc
    frappe.local.new_doc_templates[doctype] = make_new_doc(doctype)
  File "/home/asabbas/frappe-bench/apps/frappe/frappe/model/", line 37, in make_new_doc
    "docstatus": 0
  File "/home/asabbas/frappe-bench/apps/frappe/frappe/", line 525, in get_doc
    return frappe.model.document.get_doc(arg1, arg2)
  File "/home/asabbas/frappe-bench/apps/frappe/frappe/model/", line 43, in get_doc
    controller = get_controller(doctype)
  File "/home/asabbas/frappe-bench/apps/frappe/frappe/model/", line 29, in get_controller
    module = load_doctype_module(doctype, module_name)
  File "/home/asabbas/frappe-bench/apps/frappe/frappe/modules/", line 64, in load_doctype_module
    doctype_python_modules[key] = frappe.get_module(get_module_name(doctype, module, prefix))
  File "/home/asabbas/frappe-bench/apps/frappe/frappe/", line 590, in get_module
    return importlib.import_module(modulename)
  File "/usr/lib/python2.7/importlib/", line 37, in import_module
ImportError: No module named address.address

Before anyone try to help you, make sure to always share some of the information as follows:

  • Bench Version? bench --version
  • ERPNext and Frappe Version? bench version
  • Installed As? Development / Production setup
  • Are you using Customized Forms Fields / DocTypes? Yes / No (if yes, then list the as per form/doctype)
  • Share output of (ls -laih) for /home/frappe/frappe-bench/

Bench Version:
erpnext 6.12.3
frappe 6.15.1

Production Setup

Are you using Customized Forms Fields / DocTypes? Yes , But no customize field used for Address doctype

ls -laih:
total 44K
1320956 drwxrwxr-x 9 asabbas asabbas 4.0K Aug 9 11:51 .
1310769 drwxr-xr-x 9 asabbas asabbas 4.0K Aug 9 12:09 …
1320957 drwxrwxr-x 4 asabbas asabbas 4.0K Jun 3 20:51 apps
1145 drwxrwxr-x 3 asabbas asabbas 4.0K Aug 9 11:51 archived_sites
1320959 drwxrwxr-x 2 asabbas asabbas 4.0K Aug 4 18:24 config
1321776 -rw-rw-r-- 1 asabbas asabbas 236 Dec 7 2015 config.json
1320961 drwxrwxr-x 8 asabbas asabbas 4.0K Dec 5 2015 env
1320960 drwxrwxr-x 2 asabbas asabbas 4.0K Jun 27 07:29 logs
1329179 drwxrwxr-x 7 asabbas asabbas 4.0K Dec 5 2015 node_modules
1328750 -rw-rw-r-- 1 asabbas asabbas 362 Dec 5 2015 Procfile
1320958 drwxrwxr-x 11 asabbas asabbas 4.0K Aug 9 13:47 sites

@mzain most likely you have deleted an app from the apps folders and not from sites/apps.txt

@rmehta No that’s not the case … The same is working with the old site and had both of the apps i.e erpnext and frappe.

If that was the case, Than this check would have caught the exception

if name not in frappe.get_all_apps():
	raise Exception("App not in apps.txt")


Actually the issue seems to me as per my analysis is that the frappe is unable to load erpnext doctype modules.

Can anyone suggest/help on this?


Hello, maybe you already solved this problem ??? because it is giving me the same error

A search of ‘ImportError: No module named’ will land you problem reports like yours and pointers to give you ideas to try - for eg run migrate, reinstall frappe and so on

Here’s a ‘try this’ list to consider

New page error:No module named www.pagename - #5 by Derekbrenner
ImportError: No module named bleach - #3 by rmehta
ImportError: No module named shipping

1 Like