ModuleNotFoundError!

When I tried to create a new app on a fresh server I have this problem!
Is there anything must I do!
the app is installed on the site and exists in the app.txt and exists in module def
I check it from DB
Any suggestion?

regards

Hi

Did you try

bench build --force

then

bench clear-cache

yes, but same error

Try running bench setup requirements and then bench restart

I also tried this but not solved

Hi,
It’s a virtual environment issue.
Please, you can try using bench update --reset, bench setup requirements to re-install the dependencies and the Frappe applications.

1 Like

@NCP iam getting an error while trying to do “bench update --reset” and “bench setup requirements”…
Here is the error iam getting…

Please help me resolve this

Hello @Kiranmai,

Which version do you use?

please uninstall the hilltop app and then check it.

If an error occurs then please paste the error here.

and all commands applied on the frappe-bench.

Thank You!

@NCP iam using 15 version.
iam getting an error while iam trying to uninstall that app.
Here is the error iam getting…bench --site hilltop uninstall-app Hilltop --force
Traceback (most recent call last):
File “/home/kiranmai/Hilltop/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 75, in get_app_commands
app_command_module = importlib.import_module(f"{app}.commands")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “”, line 1204, in _gcd_import
File “”, line 1176, in _find_and_load
File “”, line 1126, in _find_and_load_unlocked
File “”, line 241, in _call_with_frames_removed
File “”, line 1204, in _gcd_import
File “”, line 1176, in _find_and_load
File “”, line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘Hilltop’
Could not find app “Hilltop”:
No module named ‘Hilltop’
Traceback (most recent call last):
File “/home/kiranmai/Hilltop/frappe-bench/apps/frappe/frappe/utils/caching.py”, line 55, in wrapper
return frappe.local.request_cache[func][args_key]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: -3416125850960817182

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “”, line 198, in _run_module_as_main
File “”, line 88, in _run_code
File “/home/kiranmai/Hilltop/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 114, in
main()
File “/home/kiranmai/Hilltop/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 20, in main
click.Group(commands=commands)(prog_name=“bench”)
File “/home/kiranmai/Hilltop/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/kiranmai/Hilltop/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File “/home/kiranmai/Hilltop/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/kiranmai/Hilltop/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/kiranmai/Hilltop/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/kiranmai/Hilltop/frappe-bench/env/lib/python3.11/site-packages/click/core.py”, line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/kiranmai/Hilltop/frappe-bench/env/lib/python3.11/site-packages/click/decorators.py”, line 33, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/kiranmai/Hilltop/frappe-bench/apps/frappe/frappe/commands/init.py”, line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/kiranmai/Hilltop/frappe-bench/apps/frappe/frappe/commands/site.py”, line 981, in uninstall
remove_app(app_name=app, dry_run=dry_run, yes=yes, no_backup=no_backup, force=force)
File “/home/kiranmai/Hilltop/frappe-bench/apps/frappe/frappe/installer.py”, line 354, in remove_app
app_hooks = frappe.get_hooks(app_name=app_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/kiranmai/Hilltop/frappe-bench/apps/frappe/frappe/init.py”, line 1570, in get_hooks
hooks = _dict(_load_app_hooks(app_name))
^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/kiranmai/Hilltop/frappe-bench/apps/frappe/frappe/utils/caching.py”, line 57, in wrapper
return_val = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “/home/kiranmai/Hilltop/frappe-bench/apps/frappe/frappe/init.py”, line 1542, in _load_app_hooks
app_hooks = get_module(f"{app}.hooks")
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/kiranmai/Hilltop/frappe-bench/apps/frappe/frappe/init.py”, line 1408, in get_module
return importlib.import_module(modulename)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3.11/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “”, line 1204, in _gcd_import
File “”, line 1176, in _find_and_load
File “”, line 1126, in _find_and_load_unlocked
File “”, line 241, in _call_with_frames_removed
File “”, line 1204, in _gcd_import
File “”, line 1176, in _find_and_load
File “”, line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘Hilltop’

Help me to resolve this.
Thanks in advance

Hi @Kiranmai,

Please check the module/app name in the app list and the proper name applies in the command.

App name in a small letter or not?

Otherwise, create a new site and one by one install the app and check it.

I hope this helps.

Thank You!

@NCP The error got resolved.
I deleted those apps manually and i tried “bench update --reset” and “bench setup requirements”…
Now it works fine.
Thank You

@NCP Can u please help me to fix cloning and installing app into my site from remote repository???

Hi @Kiranmai,

Please check the post.

Thank You!