Ubuntu~/frappe-bench$ sudo bench setup production sudo: bench: command not found

/frappe-bench$ sudo bench setup production
sudo: bench: command not found

I am using dns multitenat mode.
i created two sites.
I am getting this error:

/frappe-bench$ bench restart
$ supervisorctl restart frappe:
frappe: ERROR (no such group)
frappe: ERROR (no such group)
ERROR: supervisorctl restart frappe:
subprocess.CalledProcessError: Command ‘supervisorctl restart frappe:’ returned non-zero exit status 2.

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

Traceback (most recent call last):
File “/home/ubuntu/.local/bin/bench”, line 8, in
sys.exit(cli())
^^^^^
File “/home/ubuntu/.local/lib/python3.11/site-packages/bench/cli.py”, line 132, in cli
bench_command()
File “/home/ubuntu/.local/lib/python3.11/site-packages/bench/commands/utils.py”, line 41, in restart
Bench(“.”).reload(web, supervisor, systemd)
File “/home/ubuntu/.local/lib/python3.11/site-packages/bench/utils/render.py”, line 126, in wrapper_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/.local/lib/python3.11/site-packages/bench/bench.py”, line 152, in reload
restart_supervisor_processes(bench_path=self.name, web_workers=web, _raise=_raise)
File “/home/ubuntu/.local/lib/python3.11/site-packages/bench/utils/bench.py”, line 342, in restart_supervisor_processes
failure = bench.run(f"{sudo}supervisorctl restart {group}", _raise=_raise)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/.local/lib/python3.11/site-packages/bench/bench.py”, line 48, in run
return exec_cmd(cmd, cwd=cwd or self.cwd, _raise=_raise)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/ubuntu/.local/lib/python3.11/site-packages/bench/utils/init.py”, line 169, in exec_cmd
raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd)
bench.exceptions.CommandFailedError: supervisorctl restart frappe:

I added user:user in supervisord.conf file Manually
i restart supervisorctl
how to solve and make those site work

You have to make bench available for root too.

pip3 install frappe-bench
sudo pip3 install frappe-bench

best solution is to add ~/.local/bin to $PATH