ERPNext version 10 frappe install error : ImportError: No module named chat

frappe@QR:~/frappe-bench$ bench new-site site2.local
MySQL root password: 

Installing frappe...
Updating DocTypes for frappe        : [========================================]
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 94, 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/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 34, in new_site
    verbose=verbose, install_apps=install_app, source_sql=source_sql, force=force)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py", line 69, in _new_site
    _install_app(app, verbose=verbose, set_as_patched=not source_sql)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 153, in install_app
    frappe.get_attr(after_install)()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/install.py", line 19, in after_install
    install_basic_docs()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/install.py", line 72, in install_basic_docs
    frappe.get_doc(d).insert()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 245, in insert
    self.run_post_save_methods()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 887, in run_post_save_methods
    self.run_method("on_update")
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 755, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1029, in composer
    return composed(self, method, *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 1012, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py", line 749, in <lambda>
    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py", line 90, in on_update
    self.share_with_self()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py", line 178, in share_with_self
    flags={"ignore_share_permission": True})
  File "/home/frappe/frappe-bench/apps/frappe/frappe/share.py", line 42, in add
    notify_assignment(user, doctype, name, description=None, notify=notify)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/share.py", line 153, in notify_assignment
    from frappe.desk.page.chat import chat
ImportError: No module named chat

Try any of these for clues here Search results for 'ImportError: No module named' - Frappe Forum

Thanks I went through those post but doesn’t help. I also tried like (a) drop all site (b) remove frappe-bench folder and did fresh install still the error persists


TASK [create a new default site] *********************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["bench", "new-site", "site1.local", "--admin-password", "XX", "--mariadb-root-password", "XX"], "delta": "0:00:15.818182", "end": "2017-12-28 14:38:31.859662", "failed": true, "rc": 1, "start": "2017-12-28 14:38:16.041480", "stderr": "Traceback (most recent call last):\n  File \"/usr/lib/python2.7/runpy.py\", line 174, in _run_module_as_main\n    \"__main__\", fname, loader, pkg_name)\n  File \"/usr/lib/python2.7/runpy.py\", line 72, in _run_code\n    exec code in run_globals\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py\", line 94, 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/local/lib/python2.7/site-packages/click/core.py\", line 722, in __call__\n    return self.main(*args, **kwargs)\n  File \"/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py\", line 697, in main\n    rv = self.invoke(ctx)\n  File \"/home/frappe/frappe-bench/env/local/lib/python2.7/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/local/lib/python2.7/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/local/lib/python2.7/site-packages/click/core.py\", line 895, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n  File \"/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py\", line 535, in invoke\n    return callback(*args, **kwargs)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py\", line 34, in new_site\n    verbose=verbose, install_apps=install_app, source_sql=source_sql, force=force)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py\", line 69, in _new_site\n    _install_app(app, verbose=verbose, set_as_patched=not source_sql)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/installer.py\", line 153, in install_app\n    frappe.get_attr(after_install)()\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/utils/install.py\", line 19, in after_install\n    install_basic_docs()\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/utils/install.py\", line 72, in install_basic_docs\n    frappe.get_doc(d).insert()\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 245, in insert\n    self.run_post_save_methods()\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 887, in run_post_save_methods\n    self.run_method(\"on_update\")\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 755, in run_method\n    out = Document.hook(fn)(self, *args, **kwargs)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 1029, in composer\n    return composed(self, method, *args, **kwargs)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 1012, 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 749, in <lambda>\n    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py\", line 90, in on_update\n    self.share_with_self()\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py\", line 178, in share_with_self\n    flags={\"ignore_share_permission\": True})\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/share.py\", line 42, in add\n    notify_assignment(user, doctype, name, description=None, notify=notify)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/share.py\", line 153, in notify_assignment\n    from frappe.desk.page.chat import chat\nImportError: No module named chat", "stderr_lines": ["Traceback (most recent call last):", "  File \"/usr/lib/python2.7/runpy.py\", line 174, in _run_module_as_main", "    \"__main__\", fname, loader, pkg_name)", "  File \"/usr/lib/python2.7/runpy.py\", line 72, in _run_code", "    exec code in run_globals", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py\", line 94, 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/local/lib/python2.7/site-packages/click/core.py\", line 722, in __call__", "    return self.main(*args, **kwargs)", "  File \"/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py\", line 697, in main", "    rv = self.invoke(ctx)", "  File \"/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py\", line 1066, in invoke", "    return _process_result(sub_ctx.command.invoke(sub_ctx))", "  File \"/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py\", line 1066, in invoke", "    return _process_result(sub_ctx.command.invoke(sub_ctx))", "  File \"/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py\", line 895, in invoke", "    return ctx.invoke(self.callback, **ctx.params)", "  File \"/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py\", line 535, in invoke", "    return callback(*args, **kwargs)", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py\", line 34, in new_site", "    verbose=verbose, install_apps=install_app, source_sql=source_sql, force=force)", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py\", line 69, in _new_site", "    _install_app(app, verbose=verbose, set_as_patched=not source_sql)", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/installer.py\", line 153, in install_app", "    frappe.get_attr(after_install)()", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/utils/install.py\", line 19, in after_install", "    install_basic_docs()", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/utils/install.py\", line 72, in install_basic_docs", "    frappe.get_doc(d).insert()", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 245, in insert", "    self.run_post_save_methods()", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 887, in run_post_save_methods", "    self.run_method(\"on_update\")", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 755, in run_method", "    out = Document.hook(fn)(self, *args, **kwargs)", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 1029, in composer", "    return composed(self, method, *args, **kwargs)", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 1012, in runner", "    add_to_return_value(self, fn(self, *args, **kwargs))", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 749, in <lambda>", "    fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py\", line 90, in on_update", "    self.share_with_self()", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py\", line 178, in share_with_self", "    flags={\"ignore_share_permission\": True})", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/share.py\", line 42, in add", "    notify_assignment(user, doctype, name, description=None, notify=notify)", "  File \"/home/frappe/frappe-bench/apps/frappe/frappe/share.py\", line 153, in notify_assignment", "    from frappe.desk.page.chat import chat", "ImportError: No module named chat"], "stdout": "\nInstalling frappe...\n\rUpdating DocTypes for frappe        : [                                        ]\rUpdating DocTypes for frappe        : [

@ashish-greycube

Something is wrong.

Try a different stable version, because
chat will be released only in V10.1!

Hope this helps.

Thanks @krnkris and @clarkej

I am able to resolve this. I was using easy intstall
sudo python install.py --develop
This is NOT just develop mode of setup but uses branch develop
I wanted master branch but in setup mode develop. So for that I need to use
sudo python install.py --production
and then switch production mode to develop mode. link
I have done pull request for same.PR

go to DOCTYPEs, enter to the doctype with issues and click on save. Reload and it will work:)

1 Like

Yes knowledge of these sure help get you on the right track when driving the train :wink: Quick Reference Guide · frappe/bench Wiki · GitHub

1 Like

Hi,

I’m also facing this issue and am not familiar enough with ERP Next or the tips specified above to resolve it. Could someone walk me through the resolution in more detail? I’m following the Manual Install procedure and am stuck on the “bench new-site site1.local” step found here: GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps

Thank you for your assistance! :slight_smile:

Jeff

It probably doesn’t help much but the new version of chat was only added to Develop today, and likewise still has some time to go before release. i presume that something hasn’t been added to allow it to be installed afresh. The comment about doctypes may be helpful

The Manual Installation instructions don’t differentiate between Developement/Production installation options… How do I install the Production branch manually? The doctypes comment is unclear to me.

Thank you,

Jeff

You can switch to production mode with bench setup production.

8 posts were split to a new topic: UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe6 in position 5935: ordinal not in range(128)

A post was merged into an existing topic: UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe6 in position 5935: ordinal not in range(128)

Hi, fixed on latest!

Hello this is the “develop” branch, thanks for reporting the errors. If you are using for production, always use the master branch.

“bench setup production” produces the error “superuser privileges required for this command.” Trying “sudo bench setup production” gives the error “sudo: bench: command not found.” Installing bench as root using the manual instructions still leads to “bash: bench: command not found.”

Is there something I’m missing here? Why are the installation instructions so incomplete? It’s unclear as to which commands should be executed as root vs a user account. And it’s also not clear how to select a Development vs Production Install.

Thank you,

Jeff

You should run bench command from bench folder i.e.
frappe@localhost:~/frappe-bench$ sudo bench setup production

I was able to resolve my issues using the “easy_install” option on a Ubuntu 16.04 image. Initially I was trying to use Amazon Linux 2 which was making things more complicated. Thank you all for your assistance!

Jeff

go to doctypes and save again the Chat Doctype, it will work afterwards:)