Error [bench : python3 bench init for production] when install V12

Hello Everyone,

I have an error when I want to install ERPNext V12 in the local server ubuntu 20.04.

Error Log:
TASK [bench : python3 bench init for production] *******************************
task path: /tmp/.bench/bench/playbooks/roles/bench/tasks/main.yml:44
<> EXEC /bin/sh -c ‘echo ~root && sleep 0’
<> EXEC /bin/sh -c ‘( umask 77 && mkdir -p “echo /var/tmp”&& mkdir /var/tmp/ansible-tmp-1640534502.242216-86629-96541396900859 && echo ansible-tmp-1640534502.242216-86629-96541396900859=“echo /var/tmp/ansible-tmp-1640534502.242216-86629-96541396900859” ) && sleep 0’
Using module file /usr/local/lib/python3.8/dist-packages/ansible/modules/commands/
<> PUT /root/.ansible/tmp/ansible-local-66586nuwogcms/tmpgwd2b7p2 TO /var/tmp/ansible-tmp-1640534502.242216-86629-96541396900859/
<> EXEC /bin/sh -c ‘setfacl -m u:frappe:r-x /var/tmp/ansible-tmp-1640534502.242216-86629-96541396900859/ /var/tmp/ansible-tmp-1640534502.242216-86629-96541396900859/ && sleep 0’
<> EXEC /bin/sh -c ‘sudo -H -S -n -u frappe /bin/sh -c ‘"’“‘echo BECOME-SUCCESS-wtkdzmagnyiblqbscmtslzedpueunzpf ; /usr/bin/python3 /var/tmp/ansible-tmp-1640534502.242216-86629-96541396900859/’”’“’ && sleep 0’
<> EXEC /bin/sh -c ‘rm -f -r /var/tmp/ansible-tmp-1640534502.242216-86629-96541396900859/ > /dev/null 2>&1 && sleep 0’
fatal: [localhost]: FAILED! => {
“changed”: true,
“cmd”: [
GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript”,
“delta”: “0:00:00.105351”,
“end”: “2021-12-26 19:01:42.446680”,
“invocation”: {
“module_args”: {
“_raw_params”: “bench init /home/frappe/frappe-bench --frappe-path GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript --frappe-branch version-12 --python python3”,
“_uses_shell”: false,
“argv”: null,
“chdir”: null,
“creates”: “/home/frappe/frappe-bench”,
“executable”: null,
“removes”: null,
“stdin”: null,
“stdin_add_newline”: true,
“strip_empty_ends”: true,
“warn”: true
“msg”: “non-zero return code”,
“rc”: 1,
“start”: “2021-12-26 19:01:42.341329”,
“stderr”: “Traceback (most recent call last):\n File "/usr/bin/bench", line 33, in \n sys.exit(load_entry_point(‘frappe-bench’, ‘console_scripts’, ‘bench’)())\n File "/usr/bin/bench", line 22, in importlib_load_entry_point\n for entry_point in distribution(dist_name).entry_points\n File "/usr/lib/python3.8/importlib/", line 503, in distribution\n return Distribution.from_name(distribution_name)\n File "/usr/lib/python3.8/importlib/", line 177, in from_name\n raise PackageNotFoundError(name)\nimportlib.metadata.PackageNotFoundError: frappe-bench”,
“stderr_lines”: [
“Traceback (most recent call last):”,
" File "/usr/bin/bench", line 33, in ”,
" sys.exit(load_entry_point(‘frappe-bench’, ‘console_scripts’, ‘bench’)())“,
" File "/usr/bin/bench", line 22, in importlib_load_entry_point”,
" for entry_point in distribution(dist_name).entry_points",
" File "/usr/lib/python3.8/importlib/", line 503, in distribution",
" return Distribution.from_name(distribution_name)“,
" File "/usr/lib/python3.8/importlib/", line 177, in from_name”,
" raise PackageNotFoundError(name)",
“importlib.metadata.PackageNotFoundError: frappe-bench”
“stdout”: “”,
“stdout_lines”: []

PLAY RECAP *********************************************************************
localhost : ok=70 changed=43 unreachable=0 failed=1 skipped=61 rescued=0 ignored=0

Traceback (most recent call last):
File “”, line 500, in
File “”, line 281, in install_bench
run_playbook(‘site.yml’, sudo=True, extra_vars=extra_vars)
File “”, line 416, in run_playbook
success = subprocess.check_call(args, cwd=playbooks_folder, stdout=log_stream, stderr=sys.stderr)
File “/usr/lib/python3.8/”, line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘ansible-playbook’, ‘-c’, ‘local’, ‘site.yml’, ‘-vvvv’, ‘-e’, ‘@/tmp/extra_vars.json’, ‘–become’, ‘–become-user=frappe’]’ returned non-zero exit status 2.

Please your feedback ASAP,
Thank you in Advance

sudo pip3 uninstall setuptools
sudo pip3 install setuptools==59.6.0
sudo pip3 install -e /home/erp/.bench/

1 Like

Dear @mohsininspire ,
Thank you for your quick response.

after the previous error, I have faced this error:
[bench : Install ERPNext to default site]

@mohsininspire :slight_smile:

for [bench : Install ERPNext to default site] Error, I have done this:

cd frappe-bench
./env/bin/pip install numpy==1.18.5 && ./env/bin/pip install pandas==0.24.2
bench remove-app erpnext

after that, it’s work with me fine, but the big problem was I couldn’t finish Setup Wizard, and I couldn’t access the system ( without bench start :man_facepalming:t3:

Reinstall the site


Now the site is ready, but the problem remains that I cannot do bench restart, as the following message appears:

Note that I downloaded programs from GitHub without any problems

I always install the system without any problems, but this time there are many problems. I want to know if these problems are due to the file, knowing that after starting to face the errors I took the file from an old version of version 12 and did not download it via the link:

Instead of bench restart Please use sudo supervisorctl restart all

1 Like