Error bench get-app with custom application

Dear community,

I am trying to install a personal finances app which produces a very strange behaviour :

The system does not seems to work like other applications when install (I already have other apps installed with bench get-app and bench install-app) :

Here are the logs of bench get-app command :

Cloning into 'personal_finances'...
remote: Enumerating objects: 340, done.
remote: Counting objects: 100% (280/280), done.
remote: Compressing objects: 100% (278/278), done.
remote: Total 340 (delta 156), reused 0 (delta 0), pack-reused 60
Receiving objects: 100% (340/340), 58.93 KiB | 2.10 MiB/s, done.
Resolving deltas: 100% (174/174), done.
Ignoring dependencies of personal_finances. To install dependencies use --resolve-deps
Installing personal_finances
$ /home/frappe/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/frappe/frappe-bench/apps/personal_finances 
$ bench build --app personal_finances
/usr/local/lib/python3.10/runpy.py:110: UserWarning: 
`frappe` package is installed from PyPI, which isn't supported. Please install frappe using frappe bench or docker images.

- https://github.com/frappe/bench
- https://github.com/frappe/frappe_docker

  __import__(pkg_name)
/home/frappe/frappe-bench/env/bin/python: Error while finding module specification for 'frappe.utils.bench_helper' (ModuleNotFoundError: No module named 'frappe.utils')

/usr/local/lib/python3.10/runpy.py:110: UserWarning: 
`frappe` package is installed from PyPI, which isn't supported. Please install frappe using frappe bench or docker images.

- https://github.com/frappe/bench
- https://github.com/frappe/frappe_docker

  __import__(pkg_name)
/home/frappe/frappe-bench/env/bin/python: Error while finding module specification for 'frappe.utils.bench_helper' (ModuleNotFoundError: No module named 'frappe.utils')
ERROR: bench build --app personal_finances
subprocess.CalledProcessError: Command 'bench build --app personal_finances' 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 <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.10/site-packages/bench/cli.py", line 132, in cli
    bench_command()
  File "/usr/local/lib/python3.10/site-packages/bench/commands/make.py", line 159, in get_app
    get_app(
  File "/usr/local/lib/python3.10/site-packages/bench/app.py", line 444, in get_app
    app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)
  File "/usr/local/lib/python3.10/site-packages/bench/utils/render.py", line 126, in wrapper_fn
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/bench/app.py", line 242, in install
    install_app(
  File "/usr/local/lib/python3.10/site-packages/bench/app.py", line 586, in install_app
    build_assets(bench_path=bench_path, app=app)
  File "/usr/local/lib/python3.10/site-packages/bench/utils/bench.py", line 351, in build_assets
    exec_cmd(command, cwd=bench_path, env={"BENCH_DEVELOPER": "1"})
  File "/usr/local/lib/python3.10/site-packages/bench/utils/__init__.py", line 158, in exec_cmd
    raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd)
bench.exceptions.CommandFailedError: bench build --app personal_finances

As you can see, there is no problem fetching the repo. The branch is selected in the right way.

What is really strange is that after this command and error, I am completely unable to type another bench command, such as bench install-app (even for another app),bench backup, bench migrate etc… It really seems to break bench.

System specifications :

I have to say that I also tried with “custom app setup” (https://github.com/frappe/frappe_docker/blob/main/docs/custom-apps.md#use-images) in case some of you would ask about it, but it produces the same result during the image build

Steps to reproduce :

  1. Setup containers using the tutorial (exact same commands)
  2. Entering the backend container
  3. Type bench get-app YOUR_APP
  4. Get the error

Thank you in advance for your answers !

1 Like

remove frappe from requirements.txt of your custom app

1 Like

Well, you saved me a lot of time… Thank you a lot !

@revant_one whenever i try to use bench command it is giving me that error

i tried the same and it doesnt work for me
and other bench commands are not working now

SOLUTION
run bench setup requirements