Error: No such command "frappe"

Hi, while following the instructions at GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps the following error reported that frappe command couldn’t be found.

[coder@localhost frappe-bench]$ bench get-app erpnext https://github.com/frappe/erpnext
Cloning into 'erpnext'...
remote: Counting objects: 146070, done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 146070 (delta 6), reused 0 (delta 0), pack-reused 146046
Receiving objects: 100% (146070/146070), 60.92 MiB | 4.09 MiB/s, done.
Resolving deltas: 100% (106963/106963), done.
installing erpnext
Usage: bench [OPTIONS] COMMAND [ARGS]...

Error: No such command "frappe".
Traceback (most recent call last):
  File "/usr/bin/bench", line 9, in <module>
    load_entry_point('bench==0.92', 'console_scripts', 'bench')()
  File "/home/coder/erpnext/bench-repo/bench/cli.py", line 60, in cli
    bench()
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib64/python2.7/site-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/home/coder/erpnext/bench-repo/bench/cli.py", line 174, in get_app
    _get_app(name, git_url, branch=branch)
  File "/home/coder/erpnext/bench-repo/bench/app.py", line 56, in get_app
    build_assets(bench=bench)
  File "/home/coder/erpnext/bench-repo/bench/utils.py", line 166, in build_assets
    run_frappe_cmd('build', bench=bench)
  File "/home/coder/erpnext/bench-repo/bench/utils.py", line 489, in run_frappe_cmd
    raise CommandFailedError(args)
bench.utils.CommandFailedError: ('build',)

What should I do to have the frappe command available?

1 Like

Did you run bench init frappe-bench before this?

Hi @nabinhait, yes. Thus I ran into the setuptools issue (on
another post) and also have my frappe-bench directory

this is strange. Are you on the latest bench and latest apps/frappe?

Hi @pdvyas, here’s what I’ve done so far and I think it should be the latest. Please kindly correct me if I’m wrong.

git clone https://github.com/frappe/bench bench-repo
sudo pip install -e bench-repo
cd bench-repo
bench init frappe-bench 

The last step above hit into the setuptool 0.9.8 issue. Thus used a workaround

cd frappe-bench
rm -rf env
bench setup env
./env/bin/pip install -U setuptools
./env/bin/pip install -e apps/frappe/ 

successfully installed all items in requirements.txt

bench get-app erpnext https://github.com/frappe/erpnext 

The reported error happened while installing erpnext (as shown in attachment above)

Does

cd ~/frappe-bench
bench build

work fine?

Unfortunately, its back to

Error: no such command “frappe”

Below is the output of running the command

[coder@localhost erpnext]$ cd frappe-bench/
[coder@localhost frappe-bench]$ bench build
Usage: bench [OPTIONS] COMMAND [ARGS]...

Error: No such command "frappe".

Is there an option to turn on verbose logging when using bench?

Hi,
The problem here is that frappe command was in version 4, with version 5, it’s no more there. The bench cli detects the version of frappe and fires the correct command.

cd ~/frappe-bench
python -c 'import bench.utils; print bench.utils.get_current_frappe_version()'

should help debug

Hi @pdvyas, I ran the command and I’m running version 6.

Does this work?

cd ~/frappe-bench/sites
../env/bin/python -m 'frappe.utils.bench_helper' frappe build`

thanks @pdvyas. I’ve tried the instruction but got the same result of “No such command: frappe”

[coder@localhost ~]$ cd erpnext/frappe-bench/
[coder@localhost frappe-bench]$ cd sites/
[coder@localhost sites]$ ls
apps.txt
[coder@localhost sites]$ ../env/bin/python -m 'frappe.utils.bench_helper' frappe build
Usage: bench [OPTIONS] COMMAND [ARGS]...

Error: No such command "frappe"

.

Update:

I wiped clean all the previous downloads and started afresh.

git clone https://github.com/frappe/bench bench-repo
sudo pip install -e bench-repo
cd bench-repo
bench init frappe-bench
cd frappe-bench
rm -rf env
bench setup env
./env/bin/pip install -U setuptools
./env/bin/pip install -e apps/frappe/
bench get-app erpnext https://github.com/frappe/erpnext

Same error message with

Error: No such command "frappe"

Update.

Objective: to assert if the upgrade setuptools cause the error

Started clean again and followed all the same steps except upgrading setuptools.
Came back with same error.

Debug coder code shows run_frappe_cmd returned with following:

return code: 2
args = ('build',) 
kargs = {'bench': '.'}

What else can I do to assist in tracing the cause of this error?

@coder do you have another bench version installed somethere that might be being called?

hi @rmehta, thanks for your kind advise.

I tried to wipe all the previous installs and restart afresh.

However, I’ve confirmed that this is not the case by searching for all paths with bench related word.

[coder@localhost frappe-bench]$ sudo find / -iname "*bench*" -print
/home/coder/bench-repo
/home/coder/bench-repo/bench
/home/coder/bench-repo/bench.egg-info
/home/coder/bench-repo/frappe-bench
/home/coder/bench-repo/frappe-bench/apps/frappe/frappe/utils/bench_helper.py
/home/coder/bench-repo/frappe-bench/logs/bench.log
find: ‘/run/user/1000/gvfs’: Permission denied
/etc/frappe_bench_dir
/usr/bin/bench
/usr/bin/redis-benchmark
/usr/lib/modules/3.10.0-229.el7.x86_64/kernel/kernel/trace/ring_buffer_benchmark.ko
/usr/lib/modules/3.10.0-229.14.1.el7.x86_64/kernel/kernel/trace/ring_buffer_benchmark.ko
/usr/lib/python2.7/site-packages/odoo-8.0_20150929-py2.7.egg/openerp/addons/web/static/lib/qweb/qweb-benchmark.html
/usr/lib/python2.7/site-packages/odoo-8.0_20150929-py2.7.egg/openerp/addons/web/static/lib/qweb/qweb-benchmark.xml
/usr/lib/python2.7/site-packages/bench.egg-link
/usr/lib/python2.7/site-packages/frappe-6.4.6-py2.7.egg/frappe/utils/bench_helper.py
/usr/lib/python2.7/site-packages/frappe-6.4.6-py2.7.egg/frappe/utils/bench_helper.pyc
/usr/lib/python2.7/site-packages/odoo-8.0.post20150929-py2.7.egg/openerp/addons/web/static/lib/qweb/qweb-benchmark.html
/usr/lib/python2.7/site-packages/odoo-8.0.post20150929-py2.7.egg/openerp/addons/web/static/lib/qweb/qweb-benchmark.xml
/usr/lib64/libenchant.so.1
/usr/lib64/libenchant.so.1.6.0
/usr/lib64/enchant/libenchant_myspell.so
/usr/lib64/python2.7/site-packages/numpy/lib/benchmarks
/usr/lib64/python2.7/site-packages/numpy/lib/benchmarks/benchmark.py
/usr/lib64/python2.7/site-packages/numpy/lib/benchmarks/benchmark.pyc
/usr/lib64/python2.7/site-packages/numpy/lib/benchmarks/benchmark.pyo
/usr/lib64/python2.7/site-packages/numpy/ma/bench.py
/usr/lib64/python2.7/site-packages/numpy/ma/bench.pyc
/usr/lib64/python2.7/site-packages/numpy/ma/bench.pyo
/usr/share/doc/m2crypto-0.21.1/demo/ec/ecdsa_bench.py
/usr/share/doc/m2crypto-0.21.1/demo/dsa_bench.py
/usr/share/doc/m2crypto-0.21.1/demo/rsa_bench.py
/usr/share/doc/perl-File-Temp-0.23.01/misc/benchmark.pl
/usr/share/doc/perl-Digest-1.17/digest-bench
/usr/share/doc/postgresql-9.2.13/html/pgbench.html
/usr/share/doc/python-greenlet-0.4.2/benchmarks
/usr/share/doc/python-mako-0.8.1/examples/bench
/usr/share/doc/python-mako-0.8.1/examples/bench/django/templatetags/bench.py
/usr/share/doc/python-jinja2-2.7.2/examples/bench.py
/usr/share/doc/python-jinja2-2.7.2/examples/rwbench
/usr/share/doc/python-jinja2-2.7.2/examples/rwbench/rwbench.py
/usr/share/doc/nodejs-sigmund-1.0.0/bench.js
/usr/share/gnome-disk-utility/benchmark-dialog.ui
/usr/share/help/C/gnome-help/disk-benchmark.page
/usr/share/help/ca/gnome-help/disk-benchmark.page
/usr/share/help/cs/gnome-help/disk-benchmark.page
/usr/share/help/de/gnome-help/disk-benchmark.page
/usr/share/help/el/gnome-help/disk-benchmark.page
/usr/share/help/es/gnome-help/disk-benchmark.page
/usr/share/help/fi/gnome-help/disk-benchmark.page
/usr/share/help/fr/gnome-help/disk-benchmark.page
/usr/share/help/gl/gnome-help/disk-benchmark.page
/usr/share/help/hi/gnome-help/disk-benchmark.page
/usr/share/help/hu/gnome-help/disk-benchmark.page
/usr/share/help/id/gnome-help/disk-benchmark.page
/usr/share/help/it/gnome-help/disk-benchmark.page
/usr/share/help/ja/gnome-help/disk-benchmark.page
/usr/share/help/lv/gnome-help/disk-benchmark.page
/usr/share/help/nl/gnome-help/disk-benchmark.page
/usr/share/help/pa/gnome-help/disk-benchmark.page
/usr/share/help/pt_BR/gnome-help/disk-benchmark.page
/usr/share/help/ru/gnome-help/disk-benchmark.page
/usr/share/help/sl/gnome-help/disk-benchmark.page
/usr/share/help/sr/gnome-help/disk-benchmark.page
/usr/share/help/sr@latin/gnome-help/disk-benchmark.page
/usr/share/help/sv/gnome-help/disk-benchmark.page
/usr/share/help/te/gnome-help/disk-benchmark.page
/usr/share/help/vi/gnome-help/disk-benchmark.page
/usr/share/man/man3/Benchmark.3pm.gz
/usr/share/perl5/Benchmark.pm
/usr/src/kernels/3.10.0-229.14.1.el7.x86_64/include/config/ring/buffer/benchmark.h
/usr/src/kernels/3.10.0-229.14.1.el7.x86_64/tools/power/cpupower/bench

What is the next cause of action I should take to move forward?