Create New Custom App Error

Hi,

I’m trying to create a custom app, following https://frappe.io/tutorial
Currently, I have bench and erpnext installed on production in site1.local

When trying to install the new app via bench install-app myapp … it thrown me this error:

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, 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/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 16, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/commands.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/commands.py", line 163, in install_app
    _install_app(app, verbose=context.verbose)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/installer.py", line 122, in install_app
    sync_for(name, force=True, sync_everything=True, verbose=verbose)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/model/sync.py", line 37, in sync_for
    folder = os.path.dirname(frappe.get_module(app_name + "." + module_name).__file__)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/__init__.py", line 583, in get_module
    return importlib.import_module(modulename)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: Import by filename is not supported.

What’s wrong?

I was able to install new app…must stop production first then just install new-app

I have erpnext is also installed, and I want to put some customization into this custom-app …
The app folder was created, but it doesn’t appear on desk. Why?

@jof2jc Always build an app in developer setup (not production) as it will not auto-reload.

Your module will show up when you create a few DocTypes.

1 Like