Import error while installing app in a site

Hi ,

I am getting the following error while trying to install an app in a site. Is there something I am missing?

[root@localhost frappe-bench]# bench frappe finalsite --install_app finalapp
Traceback (most recent call last):
File “/home/frappe/frappe-bench/env/bin/frappe”, line 9, in
load_entry_point(‘frappe==4.13.1’, ‘console_scripts’, ‘frappe’)()
File “/home/frappe/frappe-bench/apps/frappe/frappe/cli.py”, line 53, in main
return run(fn, parsed_args)
File “/home/frappe/frappe-bench/apps/frappe/frappe/cli.py”, line 81, in run
out = globals().get(fn)(*args.get(fn), **args)
File “/home/frappe/frappe-bench/apps/frappe/frappe/cli.py”, line 67, in new_fn
return fn(*args, **new_kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/cli.py”, line 356, in install_app
install_app(app_name, verbose=verbose)
File “/home/frappe/frappe-bench/apps/frappe/frappe/installer.py”, line 114, in install_app
sync_for(name, force=True, sync_everything=True, verbose=verbose)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/sync.py”, line 28, in sync_for
folder = os.path.dirname(frappe.get_module(app_name + “.” + module_name).file)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 379, in get_module
return importlib.import_module(modulename)
File “/usr/lib64/python2.7/importlib/init.py”, line 37, in import_module
import(name)
ImportError: No module named finalapp

Thanks in advance
DN

Seems like an error related to your custom app. Does your app exist in apps.txt?

Also did you install your app via bench get-app ?

Hi,
Thanks for your response.

Yes it does exists in apps.txt. There is an entry for finalapp along with erpnext. Here is how it looks.
The apps.txt which has the entry is located insite frappe-bench/sites and looks like this below:

frappe
erpnext
shopping_cart
finalapp

We followed the easy installation steps and had installed the app via the following command:
bench new-app finalapp
This is the prompt I got next, it did not prompt me for the App Name: as in the guide example.

App Title (default Finalapp):

Am I missing something here?

Thanks
DN

@DNGupta are you trying to create a new app?

Did you complete all the steps?

In version 5, we have changed this, and the app name is “finalapp” itself.

If you are trying to install an existing app, you need to do bench get-app check bench get-app --help

@rmehta Thanks for your reply

Yes, I am trying to create a new app, with the name ‘finalapp’ but I am using version 4.
I completed all the steps, but after running the command: frappe finalsite --install_app finalapp , it throws the error which I have pasted earlier. I am unable to understand what is the issue and why the error?

Did you write any code in your app?

Run bench frappe --ipython and do import finalapp and see if there is a syntax error in your app.

bench frappe --ipython

it’s giving message like this

frappe app is not installed. Run the following command to install frappe
bench get-app GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/jigartarpara/Desktop/erp/bench-repo/bench/cli.py”, line 20, in cli
return old_frappe_cli()
File “/home/jigartarpara/Desktop/erp/bench-repo/bench/cli.py”, line 80, in old_frappe_cli
os.execv(f, [f] + sys.argv[2:])
OSError: [Errno 2] No such file or directory

but working instance of ERPNEXT is already there

This is really old,

Use bench --site sitename console

1 Like