ERPnext Installation bug on ubuntu 20.04

While installation of ERP i got this error,Can anyone please help me to resolve this issue?(Installing Erp on site)

Traceback (most recent call last):
File “/home/shwetangdalvi/WS/sts/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 68, in get_app_commands
app_command_module = importlib.import_module(app + ‘.commands’)
File “/home/shwetangdalvi/WS/sts/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 “/usr/lib/python3.8/runpy.py”, line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.8/runpy.py”, line 86, in _run_code
exec(code, run_globals)
File “/home/shwetangdalvi/WS/sts/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 99, in
main()
File “/home/shwetangdalvi/WS/sts/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/shwetangdalvi/WS/sts/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/shwetangdalvi/WS/sts/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/shwetangdalvi/WS/sts/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 “/home/shwetangdalvi/WS/sts/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 “/home/shwetangdalvi/WS/sts/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/shwetangdalvi/WS/sts/frappe-bench/env/lib/python3.8/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/shwetangdalvi/WS/sts/frappe-bench/env/lib/python3.8/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/shwetangdalvi/WS/sts/frappe-bench/apps/frappe/frappe/commands/init.py”, line 26, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/shwetangdalvi/WS/sts/frappe-bench/apps/frappe/frappe/commands/site.py”, line 199, in install_app
frappe.init(site=site)
File “/home/shwetangdalvi/WS/sts/frappe-bench/apps/frappe/frappe/init.py”, line 174, in init
setup_module_map()
File “/home/shwetangdalvi/WS/sts/frappe-bench/apps/frappe/frappe/init.py”, line 998, in setup_module_map
for module in get_module_list(app):
File “/home/shwetangdalvi/WS/sts/frappe-bench/apps/frappe/frappe/init.py”, line 868, in get_module_list
return get_file_items(os.path.join(os.path.dirname(get_module(app_name).file), “modules.txt”))
File “/home/shwetangdalvi/WS/sts/frappe-bench/apps/frappe/frappe/init.py”, line 826, in get_module
return importlib.import_module(modulename)
File “/home/shwetangdalvi/WS/sts/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’

Please show the commands you executed to arrive at that point.

Please also use code formatting to make code and output readable. See formatting here, for example: Can't use port 8000 except as NGinx upstream. What am I missing? - #5 by MartinHBramwell

1 Like

In my case, I removed ubuntu 20.04 and reinstalled ubuntu 18.04. it works well :smiley:
It seems Ubuntu 20.04 LTS is still not stable, some errors still exist.

1 Like

Ubuntu 20 works fine for me.

1 Like

These are the following commands we’ve
executeded :

  1. bench start
  2. bench --site mysite install-app erpnext (This is where we got this error while Frappe erpnext app
    installation)

This seems like a Python3.8 issue, which comes pre-packed with Ubuntu 20.04 (18.04 comes with python3.6).

I think there’s some minor issues with running Frappe/ERPNext on 3.8 right now, so an alternative on 20.04 could be to separately install python3.6 and use that as your bench env instead.

The command for moving your env is bench migrate-env <python_executable>. For example, after installing python3.6, you could run bench migrate-env python3.6.

Do not use python3.8, use 3.7

On ubuntu 20, you have to install specific versions of numpy/pandas

ubuntuRELEASE=$(lsb_release --release --short | cut -d. -f1); printf "$ubuntuRELEASE\n"

if [[ $ubuntuRELEASE -eq 20 ]]; then
  cd $HOME/frappe-bench;
  ./env/bin/pip3 install numpy==1.18.5;
  ./env/bin/pip3 install pandas==0.24.2;
fi;
4 Likes

Thanks This one Worked.

normally you should bench get-app erpnext
after downloaded erpnext, bench trying to convert erpnext into a proper python module or so called install.
when converting, seems like pandas needs numpy and if numpy >= 1.18.5, the process errored, and so far ppl recommend using pandas 0.24.2 too.

so, before, get-app erpnext, i would need to pip install numpy==1.18.5 as well pandas.
then get-app erpnext will be success.

after that, bench --site xxx.yyy.zzz install-app erpnext will be success.

1 Like

This helped. Thanks, the python is still on 3.8 and it is working after updating numpy and pandas as trentmu suggested. Thanks

2 Likes

@Shwetang_Dalvi

Refer the link