No module named 'redis.commands' , I am trying to setup frappe/eprnext for first time

bench get-app erpnext --branch version-14
A directory for the application ‘erpnext’ already exists. Do you want to continue and overwrite it? [y/N]: y
INFO: App moved from apps/erpnext to archived/apps/erpnext-2024-01-08_4
Getting erpnext
$ git clone GitHub - frappe/erpnext: Free and Open Source Enterprise Resource Planning (ERP) --branch version-14 --depth 1 --origin upstream
Cloning into ‘erpnext’…
remote: Enumerating objects: 5062, done.
remote: Counting objects: 100% (5062/5062), done.
remote: Compressing objects: 100% (4492/4492), done.
remote: Total 5062 (delta 946), reused 2244 (delta 340), pack-reused 0
Receiving objects: 100% (5062/5062), 16.36 MiB | 1.08 MiB/s, done.
Resolving deltas: 100% (946/946), done.
Updating files: 100% (4733/4733), done.
Ignoring dependencies of erpnext. To install dependencies use --resolve-deps
Installing erpnext
$ /Users/mac/Hrms/env/bin/python -m pip install --quiet --upgrade -e /Users/mac/Hrms/apps/erpnext
$ yarn install
yarn install v1.22.21
warning …/…/…/package.json: No license field
[1/4] :mag: Resolving packages…
[2/4] :truck: Fetching packages…
[3/4] :link: Linking dependencies…
[4/4] :hammer: Building fresh packages…
:sparkles: Done in 0.36s.
$ bench build --app erpnext
Traceback (most recent call last):
File “/usr/local/Cellar/python@3.10/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/”, line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/local/Cellar/python@3.10/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/”, line 86, in _run_code
exec(code, run_globals)
File “/Users/mac/Hrms/apps/frappe/frappe/utils/”, line 114, in
File “/Users/mac/Hrms/apps/frappe/frappe/utils/”, line 20, in main
File “/Users/mac/Hrms/env/lib/python3.10/site-packages/click/”, line 1157, in call
return self.main(*args, **kwargs)
File “/Users/mac/Hrms/env/lib/python3.10/site-packages/click/”, line 1078, in main
rv = self.invoke(ctx)
File “/Users/mac/Hrms/env/lib/python3.10/site-packages/click/”, line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/Users/mac/Hrms/env/lib/python3.10/site-packages/click/”, line 1685, in invoke
File “/Users/mac/Hrms/env/lib/python3.10/site-packages/click/”, line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/Users/mac/Hrms/env/lib/python3.10/site-packages/click/”, line 783, in invoke
return __callback(*args, **kwargs)
File “/Users/mac/Hrms/env/lib/python3.10/site-packages/click/”, line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File “/Users/mac/Hrms/apps/frappe/frappe/utils/”, line 44, in app_group
ctx.obj = {“sites”: get_sites(site), “force”: force, “verbose”: verbose, “profile”: profile}
File “/Users/mac/Hrms/apps/frappe/frappe/utils/”, line 56, in get_sites
elif default_site := frappe.get_conf().default_site:
File “/Users/mac/Hrms/apps/frappe/frappe/”, line 373, in get_conf
with init_site(site):
File “/Users/mac/Hrms/apps/frappe/frappe/”, line 383, in enter
File “/Users/mac/Hrms/apps/frappe/frappe/”, line 246, in init
File “/Users/mac/Hrms/apps/frappe/frappe/”, line 403, in setup_redis_cache_connection
from frappe.utils.redis_wrapper import RedisWrapper
File “/Users/mac/Hrms/apps/frappe/frappe/utils/”, line 7, in
from import Search
ModuleNotFoundError: No module named ‘redis.commands’
ERROR: bench build --app erpnext
subprocess.CalledProcessError: Command ‘bench build --app erpnext’ returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/usr/local/bin/bench”, line 8, in
File “/usr/local/lib/python3.11/site-packages/bench/”, line 132, in cli
File “/usr/local/lib/python3.11/site-packages/bench/commands/”, line 167, in get_app
File “/usr/local/lib/python3.11/site-packages/bench/”, line 444, in get_app
app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)
File “/usr/local/lib/python3.11/site-packages/bench/utils/”, line 126, in wrapper_fn
return fn(*args, **kwargs)
File “/usr/local/lib/python3.11/site-packages/bench/”, line 242, in install
File “/usr/local/lib/python3.11/site-packages/bench/”, line 586, in install_app
build_assets(bench_path=bench_path, app=app)
File “/usr/local/lib/python3.11/site-packages/bench/utils/”, line 351, in build_assets
exec_cmd(command, cwd=bench_path, env={“BENCH_DEVELOPER”: “1”})
File “/usr/local/lib/python3.11/site-packages/bench/utils/”, line 158, in exec_cmd
raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd)
bench.exceptions.CommandFailedError: bench build --app erpnext