After a recent bench update, bench start failed

The following error was shown, pls help:

16:12:21 redis_queue.1    | 3200:M 15 Sep 2022 16:12:21.141 * Ready to accept connections
16:12:21 system           | worker_short.1 started (pid=3214)
16:12:21 system           | worker_long.1 started (pid=3223)
16:12:21 system           | worker_default.1 started (pid=3229)
16:12:21 system           | watch.1 started (pid=3206)
16:12:22 schedule.1       | Traceback (most recent call last):
16:12:22 schedule.1       |   File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
16:12:22 schedule.1       |     return _run_code(code, main_globals, None,
16:12:22 schedule.1       |   File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
16:12:22 schedule.1       |     exec(code, run_globals)
16:12:22 schedule.1       |   File "/home/frapper/erpnext/apps/frappe/frappe/utils/bench_helper.py", line 104, in <module>
16:12:22 schedule.1       |     main()
16:12:22 schedule.1       |   File "/home/frapper/erpnext/apps/frappe/frappe/utils/bench_helper.py", line 19, in main
16:12:22 schedule.1       |     click.Group(commands=commands)(prog_name="bench")
16:12:22 schedule.1       |   File "/home/frapper/erpnext/env/lib/python3.10/site-packages/click/core.py", line 829, in __call__
16:12:22 schedule.1       |     return self.main(*args, **kwargs)
16:12:22 schedule.1       |   File "/home/frapper/erpnext/env/lib/python3.10/site-packages/click/core.py", line 782, in main
16:12:22 schedule.1       |     rv = self.invoke(ctx)
16:12:22 schedule.1       |   File "/home/frapper/erpnext/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
16:12:22 schedule.1       |     return _process_result(sub_ctx.command.invoke(sub_ctx))
16:12:22 schedule.1       |   File "/home/frapper/erpnext/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
16:12:22 schedule.1       |     return _process_result(sub_ctx.command.invoke(sub_ctx))
16:12:22 schedule.1       |   File "/home/frapper/erpnext/env/lib/python3.10/site-packages/click/core.py", line 1066, in invoke
16:12:22 schedule.1       |     return ctx.invoke(self.callback, **ctx.params)
16:12:22 schedule.1       |   File "/home/frapper/erpnext/env/lib/python3.10/site-packages/click/core.py", line 610, in invoke
16:12:22 schedule.1       |     return callback(*args, **kwargs)
16:12:22 schedule.1       |   File "/home/frapper/erpnext/apps/frappe/frappe/commands/scheduler.py", line 177, in start_scheduler
16:12:22 schedule.1       |     start_scheduler()
16:12:22 schedule.1       |   File "/home/frapper/erpnext/apps/frappe/frappe/utils/scheduler.py", line 40, in start_scheduler
16:12:22 schedule.1       |     schedule.every(frappe.get_conf().scheduler_tick_interval or 60).seconds.do(
16:12:22 schedule.1       |   File "/home/frapper/erpnext/apps/frappe/frappe/__init__.py", line 338, in get_conf
16:12:22 schedule.1       |     with init_site(site):
16:12:22 schedule.1       |   File "/home/frapper/erpnext/apps/frappe/frappe/__init__.py", line 348, in __enter__
16:12:22 schedule.1       |     init(self.site)
16:12:22 schedule.1       |   File "/home/frapper/erpnext/apps/frappe/frappe/__init__.py", line 256, in init
16:12:22 schedule.1       |     setup_module_map()
16:12:22 schedule.1       |   File "/home/frapper/erpnext/apps/frappe/frappe/__init__.py", line 1525, in setup_module_map
16:12:22 schedule.1       |     _cache = cache()
16:12:22 schedule.1       |   File "/home/frapper/erpnext/apps/frappe/frappe/__init__.py", line 370, in cache
16:12:22 schedule.1       |     from frappe.utils.redis_wrapper import RedisWrapper
16:12:22 schedule.1       |   File "/home/frapper/erpnext/apps/frappe/frappe/utils/redis_wrapper.py", line 7, in <module>
16:12:22 schedule.1       |     from redis.commands.search import Search
16:12:22 schedule.1       | ModuleNotFoundError: No module named 'redis.commands'
16:12:22 watch.1          | Traceback (most recent call last):
16:12:22 watch.1          |   File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
16:12:22 watch.1          |     return _run_code(code, main_globals, None,
16:12:22 watch.1          |   File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
16:12:22 watch.1          |     exec(code, run_globals)
16:12:22 watch.1          |   File "/home/frapper/erpnext/apps/frappe/frappe/utils/bench_helper.py", line 104, in <module>
16:12:22 watch.1          |     main()
16:12:22 watch.1          |   File "/home/frapper/erpnext/apps/frappe/frappe/utils/bench_helper.py", line 19, in main
16:12:22 watch.1          |     click.Group(commands=commands)(prog_name="bench")
16:12:22 watch.1          |   File "/home/frapper/erpnext/env/lib/python3.10/site-packages/click/core.py", line 829, in __call__
16:12:22 watch.1          |     return self.main(*args, **kwargs)
16:12:22 watch.1          |   File "/home/frapper/erpnext/env/lib/python3.10/site-packages/click/core.py", line 782, in main
16:12:22 watch.1          |     rv = self.invoke(ctx)
16:12:22 watch.1          |   File "/home/frapper/erpnext/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
16:12:22 watch.1          |     return _process_result(sub_ctx.command.invoke(sub_ctx))
16:12:22 watch.1          |   File "/home/frapper/erpnext/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
16:12:22 watch.1          |     return _process_result(sub_ctx.command.invoke(sub_ctx))
16:12:22 watch.1          |   File "/home/frapper/erpnext/env/lib/python3.10/site-packages/click/core.py", line 1066, in invoke
16:12:22 watch.1          |     return ctx.invoke(self.callback, **ctx.params)
16:12:22 watch.1          |   File "/home/frapper/erpnext/env/lib/python3.10/site-packages/click/core.py", line 610, in invoke
16:12:22 watch.1          |     return callback(*args, **kwargs)
16:12:22 watch.1          |   File "/home/frapper/erpnext/apps/frappe/frappe/commands/utils.py", line 91, in watch
16:12:22 watch.1          |     frappe.init("")
16:12:22 watch.1          |   File "/home/frapper/erpnext/apps/frappe/frappe/__init__.py", line 256, in init
16:12:22 watch.1          |     setup_module_map()
16:12:22 watch.1          |   File "/home/frapper/erpnext/apps/frappe/frappe/__init__.py", line 1525, in setup_module_map
16:12:22 watch.1          |     _cache = cache()
16:12:22 watch.1          |   File "/home/frapper/erpnext/apps/frappe/frappe/__init__.py", line 370, in cache
16:12:22 watch.1          |     from frappe.utils.redis_wrapper import RedisWrapper
16:12:22 watch.1          |   File "/home/frapper/erpnext/apps/frappe/frappe/utils/redis_wrapper.py", line 7, in <module>
16:12:22 watch.1          |     from redis.commands.search import Search
16:12:22 watch.1          | ModuleNotFoundError: No module named 'redis.commands'

Hi @Starrow_Pan,

Please check its topic.

Thank You!

Thanks, Please elaborate a little more. Bench normally uses the develop branch, and I somehow turned to the 14 branch? I found the erpnext and frappe repo are both on the develop branch.

Stable version 14 for follow step:

// frappe version-14
bench init --frappe-branch version-14 frappe-bench

//erpnext version-14
bench get-app --branch version-14 erpnext

Thanks. Can I stick to the develop branch which I have been using.

First, check you version:

bench version

if develop branch then don’t need to update.

But you go to version 14 then
version 14 step follow according to you.

Thank You!

In .bench, apps/frappe & apps/erpnext, git branch prints develop, however bench version gives:

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/frapper/erpnext/apps/frappe/frappe/utils/bench_helper.py", line 104, in <module>
    main()
  File "/home/frapper/erpnext/apps/frappe/frappe/utils/bench_helper.py", line 19, in main
    click.Group(commands=commands)(prog_name="bench")
  File "/home/frapper/erpnext/env/lib/python3.10/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/frapper/erpnext/env/lib/python3.10/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/frapper/erpnext/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frapper/erpnext/env/lib/python3.10/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frapper/erpnext/env/lib/python3.10/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frapper/erpnext/env/lib/python3.10/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/frapper/erpnext/apps/frappe/frappe/commands/utils.py", line 1062, in get_version
    frappe.init("")
  File "/home/frapper/erpnext/apps/frappe/frappe/__init__.py", line 256, in init
    setup_module_map()
  File "/home/frapper/erpnext/apps/frappe/frappe/__init__.py", line 1525, in setup_module_map
    _cache = cache()
  File "/home/frapper/erpnext/apps/frappe/frappe/__init__.py", line 370, in cache
    from frappe.utils.redis_wrapper import RedisWrapper
  File "/home/frapper/erpnext/apps/frappe/frappe/utils/redis_wrapper.py", line 7, in <module>
    from redis.commands.search import Search
ModuleNotFoundError: No module named 'redis.commands'