SyntaxError: Missing parentheses in call to 'print' in /healthcare/utils.py

in branch develop work on python 3 and in python 3 must have parentheses in print.
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/healthcare/utils.py”, line 310
print "do_not_update: ", do_not_update
^
SyntaxError: Missing parentheses in call to ‘print’

and other print in same python file

1- print "do_not_update: ", do_not_update
2- print "visited: ", visited
3- print child[0], child[1]

1 Like

Facing the same issue. Please fix it urgently.

Same issue here and since then i’m stuck in error status 503, please fix this urgently i can’t use my bench anymore

Could you make a PR for that issue ?

Traceback (most recent call last):
File “/usr/lib/python3.5/runpy.py”, line 184, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.5/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, lin e 97, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, lin e 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py” , line 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py” , line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py” , line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py” , line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py” , line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py” , line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/decorato rs.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 222 , in migrate
migrate(context.verbose, rebuild_website=rebuild_website)
File “/home/frappe/frappe-bench/apps/frappe/frappe/migrate.py”, line 41, in mi grate
frappe.model.sync.sync_all(verbose=verbose)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/sync.py”, line 19, in sync_all
sync_for(app, force, verbose=verbose, reset_permissions=reset_permissions)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/sync.py”, line 56, in sync_for
reset_permissions=reset_permissions, for_sync=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, li ne 65, in import_file_by_path
ignore_version=ignore_version, reset_permissions=reset_permissions)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py”, li ne 132, in import_doc
doc.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 24 9, in insert
self.run_post_save_methods()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 90 6, in run_post_save_methods
self.run_method(“on_update”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 77 3, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 10 49, in composer
return composed(self, method, *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 10 32, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 76 7, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctyp e.py”, line 264, in on_update
self.run_module_method(“on_doctype_update”)
File “/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctyp e.py”, line 329, in run_module_method
module = load_doctype_module(self.name, self.module)
File “/home/frappe/frappe-bench/apps/frappe/frappe/modules/utils.py”, line 185 , in load_doctype_module
doctype_python_modules[key] = frappe.get_module(module_name)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 783, in get_module
return importlib.import_module(modulename)
File “/home/frappe/frappe-bench/env/lib/python3.5/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 986, in _gcd_import
File “”, line 969, in _find_and_load
File “”, line 958, in _find_and_load_unlocked
File “”, line 673, in _load_unlocked
File “”, line 665, in exec_module
File “”, line 222, in call_with_frames_removed
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/payment
entry/payment_entry.py", line 11, in
from erpnext.accounts.doctype.journal_entry.journal_entry import get_default bank_cash_account
File "/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/journal
entry/journal_entry.py", line 11, in
from erpnext.hr.doctype.expense_claim.expense_claim import update_reimbursed _amount
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/expense_claim/ expense_claim.py”, line 12, in
from erpnext.accounts.doctype.sales_invoice.sales_invoice import get_bank_ca sh_account
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_in voice/sales_invoice.py”, line 27, in
from erpnext.healthcare.utils import manage_invoice_submit_cancel
File “/home/frappe/frappe-bench/apps/erpnext/erpnext/healthcare/utils.py”, lin e 310
print "do_not_update: ", do_not_update
^
SyntaxError: Missing parentheses in call to ‘print’

Is there no body to reply? I am unable to use from 2 days and tried again and again and almost read all the forum to fix it. Please

Here are the errors on fresh install of Develop branch using easy installer.

TASK [bench : Install ERPNext to default site] *********************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["bench", "--site", "site1.local", "install-app", "erpnext"], "delta": "0:00:14.313243", "end": "2018-09-08 14:50:08.035599", "msg": "non-zero return code", "rc": 1, "start": "2018-09-08 14:49:53.722356", "stderr": "Traceback (most recent call last):\n  File \"/usr/lib/python3.5/runpy.py\", line 184, in _run_module_as_main\n    \"__main__\", mod_spec)\n  File \"/usr/lib/python3.5/runpy.py\", line 85, in _run_code\n    exec(code, run_globals)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py\", line 97, in <module>\n    main()\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py\", line 18, in main\n    click.Group(commands=commands)(prog_name='bench')\n  File \"/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py\", line 722, in __call__\n    return self.main(*args, **kwargs)\n  File \"/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py\", line 697, in main\n    rv = self.invoke(ctx)\n  File \"/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py\", line 1066, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n  File \"/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py\", line 1066, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n  File \"/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py\", line 895, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n  File \"/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py\", line 535, in invoke\n    return callback(*args, **kwargs)\n  File \"/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/decorators.py\", line 17, in new_func\n    return f(get_current_context(), *args, **kwargs)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py\", line 25, in _func\n    ret = f(frappe._dict(ctx.obj), *args, **kwargs)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py\", line 165, in install_app\n    _install_app(app, verbose=context.verbose)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/installer.py\", line 145, in install_app\n    sync_for(name, force=True, sync_everything=True, verbose=verbose, reset_permissions=True)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/sync.py\", line 56, in sync_for\n    reset_permissions=reset_permissions, for_sync=True)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py\", line 65, in import_file_by_path\n    ignore_version=ignore_version, reset_permissions=reset_permissions)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py\", line 132, in import_doc\n    doc.insert()\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 249, in insert\n    self.run_post_save_methods()\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 906, in run_post_save_methods\n    self.run_method(\"on_update\")\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 773, in run_method\n    out = Document.hook(fn)(self, *args, **kwargs)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 1049, in composer\n    return composed(self, method, *args, **kwargs)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 1032, in runner\n    add_to_return_value(self, fn(self, *args, **kwargs))\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 767, in <lambda>\n    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py\", line 264, in on_update\n    self.run_module_method(\"on_doctype_update\")\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py\", line 329, in run_module_method\n    module = load_doctype_module(self.name, self.module)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/modules/utils.py\", line 185, in load_doctype_module\n    doctype_python_modules[key] = frappe.get_module(module_name)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py\", line 783, in get_module\n    return importlib.import_module(modulename)\n  File \"/home/frappe/frappe-bench/env/lib/python3.5/importlib/__init__.py\", line 126, in import_module\n    return _bootstrap._gcd_import(name[level:], package, level)\n  File \"<frozen importlib._bootstrap>\", line 986, in _gcd_import\n  File \"<frozen importlib._bootstrap>\", line 969, in _find_and_load\n  File \"<frozen importlib._bootstrap>\", line 958, in _find_and_load_unlocked\n  File \"<frozen importlib._bootstrap>\", line 673, in _load_unlocked\n  File \"<frozen importlib._bootstrap_external>\", line 665, in exec_module\n  File \"<frozen importlib._bootstrap>\", line 222, in _call_with_frames_removed\n  File \"/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py\", line 11, in <module>\n    from erpnext.hr.doctype.expense_claim.expense_claim import update_reimbursed_amount\n  File \"/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/expense_claim/expense_claim.py\", line 12, in <module>\n    from erpnext.accounts.doctype.sales_invoice.sales_invoice import get_bank_cash_account\n  File \"/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py\", line 27, in <module>\n    from erpnext.healthcare.utils import manage_invoice_submit_cancel\n  File \"/home/frappe/frappe-bench/apps/erpnext/erpnext/healthcare/utils.py\", line 310\n    print \"do_not_update: \", do_not_update\n                          ^\nSyntaxError: Missing parentheses in call to 'print'", "stderr_lines": ["Traceback (most recent call last):", "  File \"/usr/lib/python3.5/runpy.py\", line 184, in _run_module_as_main", "    \"__main__\", mod_spec)", "  File \"/usr/lib/python3.5/runpy.py\", line 85, in _run_code", "    exec(code, run_globals)", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py\", line 97, in <module>", "    main()", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py\", line 18, in main", "    click.Group(commands=commands)(prog_name='bench')", "  File \"/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py\", line 722, in __call__", "    return self.main(*args, **kwargs)", "  File \"/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py\", line 697, in main", "    rv = self.invoke(ctx)", "  File \"/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py\", line 1066, in invoke", "    return _process_result(sub_ctx.command.invoke(sub_ctx))", "  File \"/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py\", line 1066, in invoke", "    return _process_result(sub_ctx.command.invoke(sub_ctx))", "  File \"/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py\", line 895, in invoke", "    return ctx.invoke(self.callback, **ctx.params)", "  File \"/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/core.py\", line 535, in invoke", "    return callback(*args, **kwargs)", "  File \"/home/frappe/frappe-bench/env/lib/python3.5/site-packages/click/decorators.py\", line 17, in new_func", "    return f(get_current_context(), *args, **kwargs)", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/commands/__init__.py\", line 25, in _func", "    ret = f(frappe._dict(ctx.obj), *args, **kwargs)", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py\", line 165, in install_app", "    _install_app(app, verbose=context.verbose)", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/installer.py\", line 145, in install_app", "    sync_for(name, force=True, sync_everything=True, verbose=verbose, reset_permissions=True)", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/sync.py\", line 56, in sync_for", "    reset_permissions=reset_permissions, for_sync=True)", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py\", line 65, in import_file_by_path", "    ignore_version=ignore_version, reset_permissions=reset_permissions)", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/modules/import_file.py\", line 132, in import_doc", "    doc.insert()", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 249, in insert", "    self.run_post_save_methods()", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 906, in run_post_save_methods", "    self.run_method(\"on_update\")", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 773, in run_method", "    out = Document.hook(fn)(self, *args, **kwargs)", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 1049, in composer", "    return composed(self, method, *args, **kwargs)", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 1032, in runner", "    add_to_return_value(self, fn(self, *args, **kwargs))", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 767, in <lambda>", "    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py\", line 264, in on_update", "    self.run_module_method(\"on_doctype_update\")", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/doctype/doctype.py\", line 329, in run_module_method", "    module = load_doctype_module(self.name, self.module)", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/modules/utils.py\", line 185, in load_doctype_module", "    doctype_python_modules[key] = frappe.get_module(module_name)", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py\", line 783, in get_module", "    return importlib.import_module(modulename)", "  File \"/home/frappe/frappe-bench/env/lib/python3.5/importlib/__init__.py\", line 126, in import_module", "    return _bootstrap._gcd_import(name[level:], package, level)", "  File \"<frozen importlib._bootstrap>\", line 986, in _gcd_import", "  File \"<frozen importlib._bootstrap>\", line 969, in _find_and_load", "  File \"<frozen importlib._bootstrap>\", line 958, in _find_and_load_unlocked", "  File \"<frozen importlib._bootstrap>\", line 673, in _load_unlocked", "  File \"<frozen importlib._bootstrap_external>\", line 665, in exec_module", "  File \"<frozen importlib._bootstrap>\", line 222, in _call_with_frames_removed", "  File \"/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/journal_entry/journal_entry.py\", line 11, in <module>", "    from erpnext.hr.doctype.expense_claim.expense_claim import update_reimbursed_amount", "  File \"/home/frappe/frappe-bench/apps/erpnext/erpnext/hr/doctype/expense_claim/expense_claim.py\", line 12, in <module>", "    from erpnext.accounts.doctype.sales_invoice.sales_invoice import get_bank_cash_account", "  File \"/home/frappe/frappe-bench/apps/erpnext/erpnext/accounts/doctype/sales_invoice/sales_invoice.py\", line 27, in <module>", "    from erpnext.healthcare.utils import manage_invoice_submit_cancel", "  File \"/home/frappe/frappe-bench/apps/erpnext/erpnext/healthcare/utils.py\", line 310", "    print \"do_not_update: \", do_not_update", "                          ^", "SyntaxError: Missing parentheses in call to 'print'"], "stdout": "\nInstalling erpnext...\n\rUpdating DocTypes for erpnext       : [                                        ]\rUpdating DocTypes for erpnext       : [                                        ]\rUpdating DocTypes for erpnext       : [                                        ]\rUpdating DocTypes for erpnext       : [                                        ]\rUpdating DocTypes for erpnext       : [                                        ]\rUpdating DocTypes for erpnext       : [                                        ]\rUpdating DocTypes for erpnext       : [                                        ]\rUpdating DocTypes for erpnext       : [                                        ]\rUpdating DocTypes for erpnext       : [                                        ]\rUpdating DocTypes for erpnext       : [                                        ]\rUpdating DocTypes for erpnext       : [                                        ]\rUpdating DocTypes for erpnext       : [                                        ]\rUpdating DocTypes for erpnext       : [                                        ]\rUpdating DocTypes for erpnext       : [                                        ]\rUpdating DocTypes for erpnext       : [                                        ]\rUpdating DocTypes for erpnext       : [                                        ]\rUpdating DocTypes for erpnext       : [                                        ]\rUpdating DocTypes for erpnext       : [                                        ]\rUpdating DocTypes for erpnext       : [=                                       ]\rUpdating DocTypes for erpnext       : [=                                       ]\rUpdating DocTypes for erpnext       : [=                                       ]\rUpdating DocTypes for erpnext       : [=                                       ]\rUpdating DocTypes for erpnext       : [=                                       ]\rUpdating DocTypes for erpnext       : [=                                       ]\rUpdating DocTypes for erpnext       : [=                                       ]\rUpdating DocTypes for erpnext       : [=                                       ]\rUpdating DocTypes for erpnext       : [=                                       ]\rUpdating DocTypes for erpnext       : [=                                       ]", "stdout_lines": ["", "Installing erpnext...", "", "Updating DocTypes for erpnext       : [                                        ]", "Updating DocTypes for erpnext       : [                                        ]", "Updating DocTypes for erpnext       : [                                        ]", "Updating DocTypes for erpnext       : [                                        ]", "Updating DocTypes for erpnext       : [                                        ]", "Updating DocTypes for erpnext       : [                                        ]", "Updating DocTypes for erpnext       : [                                        ]", "Updating DocTypes for erpnext       : [                                        ]", "Updating DocTypes for erpnext       : [                                        ]", "Updating DocTypes for erpnext       : [                                        ]", "Updating DocTypes for erpnext       : [                                        ]", "Updating DocTypes for erpnext       : [                                        ]", "Updating DocTypes for erpnext       : [                                        ]", "Updating DocTypes for erpnext       : [                                        ]", "Updating DocTypes for erpnext       : [                                        ]", "Updating DocTypes for erpnext       : [                                        ]", "Updating DocTypes for erpnext       : [                                        ]", "Updating DocTypes for erpnext       : [                                        ]", "Updating DocTypes for erpnext       : [=                                       ]", "Updating DocTypes for erpnext       : [=                                       ]", "Updating DocTypes for erpnext       : [=                                       ]", "Updating DocTypes for erpnext       : [=                                       ]", "Updating DocTypes for erpnext       : [=                                       ]", "Updating DocTypes for erpnext       : [=                                       ]", "Updating DocTypes for erpnext       : [=                                       ]", "Updating DocTypes for erpnext       : [=                                       ]", "Updating DocTypes for erpnext       : [=                                       ]", "Updating DocTypes for erpnext       : [=                                       ]"]}
	to retry, use: --limit @/tmp/.bench/playbooks/site.retry

PLAY RECAP *********************************************************************
localhost                  : ok=55   changed=33   unreachable=0    failed=1

@ahmed-madi Sure fix Missing parentheses in call to 'print' by ahmedzaqout · Pull Request #15358 · frappe/erpnext · GitHub

1 Like

Fix has been merged, the problem should be resolved!

@codingCoffee The problem has been solved .:smiley: