ValueError installing erpnext

get the following error when installing erpnext app. on new site or any site.
ValueError: Document for field “field_order” attached to child table of “Payment Order” must be a dict or BaseDocument, not type ‘unicode’ (naming_series)

please advise,
This is a clean install of bench. No custom changes have been made.

Python 2.7, Ubuntu 18 LTS with latest updates,
bench obtained git clone GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps bench-repo
pip install --user -e bench-repo


It might help to describe the operating environment, how bench was obtained and installed, version of Python etc.

Also to promote code search please copy and paste the complete traceback

1 Like
bench install-app erpnext      
Installing erpnext...
Traceback (most recent call last):
  File "/usr/lib/python2.7/", line 174, 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 "/opt/erpnext/frappe-bench/apps/frappe/frappe/utils/", line 97, in <module>
  File "/opt/erpnext/frappe-bench/apps/frappe/frappe/utils/", line 18, in main
  File "/opt/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/opt/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/", line 717, in main
    rv = self.invoke(ctx)
  File "/opt/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/", line 555, in invoke
    return callback(*args, **kwargs)
  File "/opt/erpnext/frappe-bench/env/local/lib/python2.7/site-packages/click/", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/opt/erpnext/frappe-bench/apps/frappe/frappe/commands/", line 25, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/opt/erpnext/frappe-bench/apps/frappe/frappe/commands/", line 168, in install_app
    _install_app(app, verbose=context.verbose)
  File "/opt/erpnext/frappe-bench/apps/frappe/frappe/", line 145, in install_app
    sync_for(name, force=True, sync_everything=True, verbose=verbose, reset_permissions=True)
  File "/opt/erpnext/frappe-bench/apps/frappe/frappe/model/", line 56, in sync_for
    reset_permissions=reset_permissions, for_sync=True)
  File "/opt/erpnext/frappe-bench/apps/frappe/frappe/modules/", line 65, in import_file_by_path
    ignore_version=ignore_version, reset_permissions=reset_permissions)
  File "/opt/erpnext/frappe-bench/apps/frappe/frappe/modules/", line 100, in import_doc
    doc = frappe.get_doc(docdict)
  File "/opt/erpnext/frappe-bench/apps/frappe/frappe/", line 734, in get_doc
    doc = frappe.model.document.get_doc(*args, **kwargs)
  File "/opt/erpnext/frappe-bench/apps/frappe/frappe/model/", line 69, in get_doc
    return controller(*args, **kwargs)
  File "/opt/erpnext/frappe-bench/apps/frappe/frappe/model/", line 113, in __init__
    super(Document, self).__init__(kwargs)
  File "/opt/erpnext/frappe-bench/apps/frappe/frappe/model/", line 54, in __init__
  File "/opt/erpnext/frappe-bench/apps/frappe/frappe/model/", line 77, in update
    self.set(key, value)
  File "/opt/erpnext/frappe-bench/apps/frappe/frappe/model/", line 124, in set
    self.extend(key, value)
  File "/opt/erpnext/frappe-bench/apps/frappe/frappe/model/", line 161, in extend
    self.append(key, v)
  File "/opt/erpnext/frappe-bench/apps/frappe/frappe/model/", line 155, in append, str(type(value))[1:-1], value)
ValueError: Document for field "field_order" attached to child table of "Payment Order" must be a dict or BaseDocument, not type 'unicode' (naming_series)

This similar traceback Telegram Integration Custom App - #10 by youssef

suggests move to Python 3.5+ or v12?