Bench commands stopped working

I recently made a bench update in a local instance and all the bench commands like: bench update, bench init, bench migrate, etc stopped working. throwing the [Error 2] No such file and directory: ‘./sites’. The last commit that modified the bench/ file prevent the commands reach the bench_commands() function.

Please fix it.

Your error usually means your Current Working Directory is incorrect. Some Bench commands only work correctly, if executed from the proper directory.

When launching your Bench commands, you want your working directory to be the parent of “./sites”. Which is usually “frappe-bench”.

As an example, on my laptop, that full path is home/myuser/erpnext/development/frappe-bench/.

I’m getting the same error even after running the command in the right directory

This is the error :

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.11/bin/bench", line 5, in <module>
    from bench.cli import cli
ModuleNotFoundError: No module named 'bench'