ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

'Could not find app' while trying to install a new app

Hello,

I’m getting errors when I try to install a new app on a site.

I created the app using bench make-app DESTINATION fixturesapp
I edited the new app’s hook.py file to export custom fields from my site.

I can see the app’s folder in frappe-bench/apps/fixturesapp
When I try to install the app on my site using
bench --site erpnext.localhost install-app fixturesapp

~/frappe-bench$ bench --site erpnext.localhost install-app fixturesapp
Could not find app “fixturesapp”
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 18, in
[sys.executable, bench_helper, ‘frappe’] + sys.argv[1:],
File “/usr/local/lib/python3.7/subprocess.py”, line 363, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[’/home/frappe/frappe-bench/env/bin/python’, ‘/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py’, ‘frappe’, ‘–site’, ‘erpnext.localhost’, ‘install-app’, ‘fixturesapp’]’ returned non-zero exit status 1.

I tried adding the app’s name manually in app.txt file, when I do that, I get this error

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 189, in install_app
_install_app(app, verbose=context.verbose)
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 128, in install_app
frappe.clear_cache()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 635, in clear_cache
frappe.cache_manager.clear_user_cache()
File “/home/frappe/frappe-bench/apps/frappe/frappe/cache_manager.py”, line 48, in clear_user_cache
clear_global_cache()
File “/home/frappe/frappe-bench/apps/frappe/frappe/cache_manager.py”, line 61, in clear_global_cache
frappe.setup_module_map()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1086, in setup_module_map
for module in get_module_list(app):
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 952, 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 910, in get_module
return importlib.import_module(modulename)
File “/usr/local/lib/python3.7/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1006, in _gcd_import
File “”, line 983, in _find_and_load
File “”, line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘fixturesapp’

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 189, in install_app
_install_app(app, verbose=context.verbose)
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 128, in install_app
frappe.clear_cache()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 635, in clear_cache
frappe.cache_manager.clear_user_cache()
File “/home/frappe/frappe-bench/apps/frappe/frappe/cache_manager.py”, line 48, in clear_user_cache
clear_global_cache()
File “/home/frappe/frappe-bench/apps/frappe/frappe/cache_manager.py”, line 61, in clear_global_cache
frappe.setup_module_map()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1086, in setup_module_map
for module in get_module_list(app):
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 952, 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 910, in get_module
return importlib.import_module(modulename)
File “/usr/local/lib/python3.7/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1006, in _gcd_import
File “”, line 983, in _find_and_load
File “”, line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘fixturesapp’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 101, in
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/lib/python3.7/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 27, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 196, in install_app
print(“An error occurred while installing {}{}”.format(app, err_msg))
UnboundLocalError: local variable ‘err_msg’ referenced before assignment
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 18, in
[sys.executable, bench_helper, ‘frappe’] + sys.argv[1:],
File “/usr/local/lib/python3.7/subprocess.py”, line 363, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[’/home/frappe/frappe-bench/env/bin/python’, ‘/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py’, ‘frappe’, ‘–site’, ‘erpnext.localhost’, ‘install-app’, ‘fixturesapp’]’ returned non-zero exit status 1.

So I manually added a new module in Module Def list in the erpnext site and then I tried again and got the same error.

I installed frappe-bench using the single bench method, and deployed using Docker Compose because I don’t have a linux system.

Ultimately, I want to use bench --site erpnext.localhost export-fixtures to push my custom fields to a github repo.

I appreciate the support.