I am setting up ERPNext dev environment on Docker based on the documention and I cannot get it to debug. When I debug it thorws an error “No module named ‘frappe’”. Tried reinstalling this many times and no success. This is on a Ubuntu 20.04.
Documentation followed : frappe_docker/development at main · frappe/frappe_docker · GitHub
I have done this before on same Ubuntu version and did not encounter any errors. Following is the error I am getting and please help me fix it.
Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/frappe/.vscode-server/extensions/ms-python.python-2021.9.1230869389/pythonFiles/lib/python/debugpy/__main__.py", line 45, in <module>
cli.main()
File "/home/frappe/.vscode-server/extensions/ms-python.python-2021.9.1230869389/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 444, in main
run()
File "/home/frappe/.vscode-server/extensions/ms-python.python-2021.9.1230869389/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 285, in run_file
runpy.run_path(target_as_str, run_name=compat.force_str("__main__"))
File "/usr/lib/python3.7/runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "/usr/lib/python3.7/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/workspace/development/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 3, in <module>
import frappe
ModuleNotFoundError: No module named 'frappe'
$ cd /workspace/development/frappe-bench/sites ; /usr/bin/env /usr/bin/python3 /home/frappe/.vscode-server/extensions/ms-python.python-2021.9.1230869389/pythonFiles/lib/python/debugpy/launcher 44473 -- /workspace/development/frappe-bench/apps/frappe/frappe/utils/bench_helper.py frappe worker --queue long
$ cd /workspace/development/frappe-bench/sites ; /usr/bin/env /usr/bin/python3 /home/frappe/.vscode-server/extensions/ms-python.python-2021.9.1230869389/pythonFiles/lib/python/debugpy/launcher 34775 -- /workspace/development/frappe-bench/apps/frappe/frappe/utils/bench_helper.py frappe serve --port 8000 --noreload --nothreading