Jasper Reports "No Module Named"

Hello.

I’ve been trying to integrate Jasper Reports with ERPNext, I’m following the instructions from https://github.com/saguas/jasper_erpnext_report

Once I get to step 4, trying to install the app jasper_erpnext_report, I get the following 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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, 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 700, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/home/frappe/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/frappe/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/frappe/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/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 16, in new_fu
nc
    return f(get_current_context(), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands.py", line 163, in install_app
    _install_app(app, verbose=context.verbose)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 93, in install_app
    app_hooks = frappe.get_hooks(app_name=name)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 694, in get_hooks
    hooks = _dict(load_app_hooks(app_name))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 667, in load_app_hooks
    app_hooks = get_module(app + ".hooks")
  File "/home/frappe/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: No module named jasper_erpnext_report

I double checked and the app jasper_erpnext_report does exist.

fatal: destination path 'jasper_erpnext_report' already exists and is not an empty directory.

Has anything changed that I’m now aware of?

Thanks

1 Like

This is not particular to Jasper. While creating and installing any custom app, the is case sensitive. Make sure the casing is uniform in all places( apps.txt, bench install-app , folder name)
refer:

Thanks @krithi_ramani

I double checked what you suggested and got slightly the same error. The commands ran from the frappe-bench folder.

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/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 79, in <module>
    main()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 16, 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 700, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 680, in main
    rv = self.invoke(ctx)
  File "/home/frappe/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/frappe/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/frappe/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/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py", line 16, in new_fu
nc
    return f(get_current_context(), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands.py", line 29, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/commands.py", line 163, in install_app
    _install_app(app, verbose=context.verbose)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/installer.py", line 93, in install_app
    app_hooks = frappe.get_hooks(app_name=name)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 694, in get_hooks
    hooks = _dict(load_app_hooks(app_name))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 667, in load_app_hooks
    app_hooks = get_module(app + ".hooks")
  File "/home/frappe/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)
  File "/home/frappe/frappe-bench/apps/jasper_erpnext_report/jasper_erpnext_report/__init__.py", line 16, in <mo
dule>
    from .utils.utils import get_Frappe_Version
  File "/home/frappe/frappe-bench/apps/jasper_erpnext_report/jasper_erpnext_report/utils/utils.py", line 10, in 
<module>
    from . jasper_email import set_jasper_email_doctype
  File "/home/frappe/frappe-bench/apps/jasper_erpnext_report/jasper_erpnext_report/utils/jasper_email.py", line 
9, in <module>
    from jasper_erpnext_report.utils.file import get_jasper_path, write_file, get_html_reports_path
  File "/home/frappe/frappe-bench/apps/jasper_erpnext_report/jasper_erpnext_report/utils/file.py", line 10, in <
module>
    from jasper_erpnext_report.utils.jrxml import *
  File "/home/frappe/frappe-bench/apps/jasper_erpnext_report/jasper_erpnext_report/utils/jrxml.py", line 6, in <
module>
    from lxml import etree
ImportError: No module named lxml

Hi William,

Where you ever able to resolve this? I am running into the same error.

Thanks!