ModuleNotFoundError: No module named 'erpnext'

This is my error.

Traceback (most recent call last):
File “/Users/dustingerardm.ancog/Desktop/Dev/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 68, in get_app_commands
app_command_module = importlib.import_module(app + ‘.commands’)
File “/Users/dustingerardm.ancog/Desktop/Dev/frappe/frappe-bench/env/lib/python3.8/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 961, in _find_and_load_unlocked
File “”, line 219, in _call_with_frames_removed
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘erpnext’
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py”, line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “/Users/dustingerardm.ancog/Desktop/Dev/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 99, in
main()
File “/Users/dustingerardm.ancog/Desktop/Dev/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/Users/dustingerardm.ancog/Desktop/Dev/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/Users/dustingerardm.ancog/Desktop/Dev/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/Users/dustingerardm.ancog/Desktop/Dev/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/Users/dustingerardm.ancog/Desktop/Dev/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/Users/dustingerardm.ancog/Desktop/Dev/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/Users/dustingerardm.ancog/Desktop/Dev/frappe/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/Users/dustingerardm.ancog/Desktop/Dev/frappe/frappe-bench/apps/frappe/frappe/commands/utils.py”, line 26, in build
frappe.init(‘’)
File “/Users/dustingerardm.ancog/Desktop/Dev/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 185, in init
setup_module_map()
File “/Users/dustingerardm.ancog/Desktop/Dev/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1027, in setup_module_map
for module in get_module_list(app):
File “/Users/dustingerardm.ancog/Desktop/Dev/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 896, in get_module_list
return get_file_items(os.path.join(os.path.dirname(get_module(app_name).file), “modules.txt”))
File “/Users/dustingerardm.ancog/Desktop/Dev/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 854, in get_module
return importlib.import_module(modulename)
File “/Users/dustingerardm.ancog/Desktop/Dev/frappe/frappe-bench/env/lib/python3.8/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1014, in _gcd_import
File “”, line 991, in _find_and_load
File “”, line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘erpnext’
(frappe) Dustins-MacBook-Pro:frappe-bench dustingerardm.ancog$
(frappe) Dustins-MacBook-Pro:frappe-bench dustingerardm.ancog$

Hello,

Did you ever manage to solve this? I’m getting the same error upon installing erpnext app in my bench.

Thanks

it seems like the install process always breaks at one point or another :frowning:

try this:

sudo python3 install.py --user frappe

EDIT: still fails with above :frowning:

1 Like

Seems like a virtual environment issue. It would help to know more info about your systems (OS, Python, Bench, Frappe/ERPNext, etc.)

Can you try using bench setup requirements to re-install the dependencies and the Frappe applications?

Looking at the traceback, I see that the original author had Python 3.8 installed, which I’ve never had luck getting a stable bench on. You could try changing the Python version to 3.6 and try again.

2 Likes

Hi,

How did you resolve this? I got the same error. I’ll appreciate iyt if you could help me with this.

Regards,