Following the documentation, I am trying to create and use a new app on the latest non-development version of frappe available, visible below:
$ bench version
erpnext 10.1.54
frappe 10.1.49
Running the following works as expected:
$ bench new-app bsb
INFO:bench.app:creating new app bsb
App Title (default: Test): bsb
App Description: bsb
App Publisher: bsb
App Email: bsb@bsb.com
App Icon (default 'octicon octicon-file-directory'):
App Color (default 'grey'):
App License (default 'MIT'):
'bsb' created at /home/frappe/frappe-bench/apps/bsb
INFO:bench.app:installing bsb
INFO:bench.utils:./env/bin/pip install -q -e ./apps/bsb --no-cache-dir
I now have a folder in ~/frappe-bench/apps called âbsbâ set up exactly as I would expect.
Trying to install the app however does not work.
$ bench install-app bsb
Traceback (most recent call last):
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 64, in get_app_commands
app_command_module = importlib.import_module(app + '.commands')
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named bsb.commands
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 94, in <module>
main()
File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 18, in main
click.Group(commands=commands)(prog_name='bench')
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/frappe/frappe-bench/apps/frappe/frappe/commands/utils.py", line 447, in get_version
frappe.init('')
File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 158, in init
setup_module_map()
File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 872, in setup_module_map
for module in get_module_list(app):
File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 746, in get_module_list
return get_file_items(os.path.join(os.path.dirname(get_module(app_name).__file__), "modules.txt"))
File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 704, in get_module
return importlib.import_module(modulename)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named bsb
At this point, all bench commands result in this same error message and the ERP site itself displays the following on all pages:
The only way to fix the issue that I have found is to remove âbsbâ from ~/frappe-bench/sites/apps.txt, at which point ERPNext returns to normal but I cannot use bench execute on my python scripts. Can anybody help me figure out whatâs going wrong with bench new-app?