Fatal Error on 'create new site'

Hello fam, please I am trying to run erpnext on a fresh ubuntu 18.04 Desktop, using the Easy install method on Github. Every other step worked correctly but for the last one, when it came to [create site] see error below. I appreciate your suggestions.

TASK [bench : Create a new site] ***********************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["bench", "new-site", "site1.local", "--admin-password", "newistt123", "--mariadb-root-password", "newistt123"], "delta": "0:00:00.777408", "end": "2018-11-10 14:54:34.866020", "msg": "non-zero return code", "rc": 2, "start": "2018-11-10 14:54:34.088612", "stderr": "Usage: bench [OPTIONS] COMMAND [ARGS]...\nTry \"bench --help\" for help.\n\nError: No such command \"new-site\".", "stderr_lines": ["Usage: bench [OPTIONS] COMMAND [ARGS]...", "Try \"bench --help\" for help.", "", "Error: No such command \"new-site\"."], "stdout": "", "stdout_lines": []}
    to retry, use: --limit @/tmp/.bench/playbooks/site.retry

PLAY RECAP *********************************************************************
localhost                  : ok=75   changed=15   unreachable=0    failed=1   

Traceback (most recent call last):
  File "install.py", line 420, in <module>
    install_bench(args)
  File "install.py", line 122, in install_bench
    run_playbook('site.yml', sudo=True, extra_vars=extra_vars)
  File "install.py", line 338, in run_playbook
    success = subprocess.check_call(args, cwd=os.path.join(cwd, 'playbooks'))
  File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'site.yml', '-e', '@/tmp/extra_vars.json', '--become', '--become-user=frappe']' returned non-zero exit status 2

Hmmm.

It seems the command was run outside the frappe-bench directory.

Also from GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps

Works on Ubuntu 16.04, CentOS 7+, Debian 8+

Try it on 16.04 fresh install.

Login as root and run command below:

python install.py --develop --user frappe

But I want to run it as production… or using --develop doesn’t matter?

You can change to production:
python install.py --production --user frappe

But that’s the exact command i ran before i got to this error. sudo python install.py --production --user frappe

Login as root, don’t use sudo.

hello i logged in as root, but same error. Please see

ASK [bench : Create a new site] ***********************************************
fatal: [localhost]: FAILED! => {“changed”: true, “cmd”: [“bench”, “new-site”, “site1.local”, “–admin-password”, “newistt123”, “–mariadb-root-password”, “newistt123”], “delta”: “0:00:01.106301”, “end”: “2018-11-11 10:34:42.782720”, “msg”: “non-zero return code”, “rc”: 2, “start”: “2018-11-11 10:34:41.676419”, “stderr”: “Usage: bench [OPTIONS] COMMAND [ARGS]…\nTry "bench --help" for help.\n\nError: No such command "new-site".”, “stderr_lines”: [“Usage: bench [OPTIONS] COMMAND [ARGS]…”, “Try "bench --help" for help.”, “”, “Error: No such command "new-site".”], “stdout”: “”, “stdout_lines”: []}
to retry, use: --limit @/tmp/.bench/playbooks/site.retry

PLAY RECAP *********************************************************************
localhost : ok=75 changed=18 unreachable=0 failed=1

Traceback (most recent call last):
File “install.py”, line 420, in
install_bench(args)
File “install.py”, line 122, in install_bench
run_playbook(‘site.yml’, sudo=True, extra_vars=extra_vars)
File “install.py”, line 338, in run_playbook
success = subprocess.check_call(args, cwd=os.path.join(cwd, ‘playbooks’))
File “/usr/lib/python2.7/subprocess.py”, line 190, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘ansible-playbook’, ‘-c’, ‘local’, ‘site.yml’, ‘-e’, ‘@/tmp/extra_vars.json’, ‘–become’, ‘–become-user=frappe’]’ returned non-zero exit status 2
root@newistt-HP-Notebook:~#

I had a little success in setting up on Ubuntu 18.04 by easy install.

Can u try manual install?

Thanks a lot for the concern @magic-overflow. I will try some options and let you know.

Hi ,

Just encountered this same issue trying to do a fresh install on Ubuntu 18.04

Any solution?

  "stderr": "Usage: bench [OPTIONS] COMMAND [ARGS]...\n\nError: No such command \"new-site\".",
    "stderr_lines": [
        "Usage: bench [OPTIONS] COMMAND [ARGS]...",
        "",
        "Error: No such command \"new-site\"."
    ],
    "stdout": "/home/frappe/frappe-bench/env/bin/python: Error while finding module specification for 'frappe.utils.bench_helper' (ModuleNotFoundError: No module named 'frappe')",
    "stdout_lines": [
        "/home/frappe/frappe-bench/env/bin/python: Error while finding module specification for 'frappe.utils.bench_helper' (ModuleNotFoundError: No module named 'frappe')"
    ]
}

PLAY RECAP *********************************************************************
localhost                  : ok=73   changed=13   unreachable=0    failed=1    skipped=55   rescued=0    ignored=0

Traceback (most recent call last):
  File "install.py", line 413, in <module>
    install_bench(args)
  File "install.py", line 135, in install_bench
    run_playbook('site.yml', sudo=True, extra_vars=extra_vars)
  File "install.py", line 327, in run_playbook
    success = subprocess.check_call(args, cwd=os.path.join(cwd, 'playbooks'))
  File "/usr/lib/python2.7/subprocess.py", line 190, 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

Any suggestions here please?

I tried to install on a fresh VPS and got the error below:

TASK [bench : python3 bench init for production] *******************************
task path: /tmp/.bench/playbooks/roles/bench/tasks/main.yml:37
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c 'echo ~root && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /var/tmp/ansible-tmp-1565693906.0971105-265280960161005 `" && echo ansible-tmp-1565693906.0971105-265280960161005="` echo /var/tmp/ansible-tmp-1565693906.0971105-265280960161005 `" ) && sleep 0'
Using module file /usr/local/lib/python3.6/dist-packages/ansible/modules/commands/command.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-270770h79rr01/tmpgngz9i3f TO /var/tmp/ansible-tmp-1565693906.0971105-265280960161005/AnsiballZ_command.py
<127.0.0.1> EXEC /bin/sh -c 'setfacl -m u:frappe:r-x /var/tmp/ansible-tmp-1565693906.0971105-265280960161005/ /var/tmp/ansible-tmp-1565693906.0971105-265280960161005/AnsiballZ_command.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -n  -u frappe /bin/sh -c '"'"'echo BECOME-SUCCESS-tmynybtwnknggoskjboadmipbykepcst ; /usr/bin/python3 /var/tmp/ansible-tmp-1565693906.0971105-265280960161005/AnsiballZ_command.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /var/tmp/ansible-tmp-1565693906.0971105-265280960161005/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
    "changed": true,
    "cmd": [
        "bench",
        "init",
        "/home/frappe/frappe-bench",
        "--frappe-path",
        "https://github.com/frappe/frappe",
        "--frappe-branch",
        "version-12",
        "--python",
        "python3"
    ],
    "delta": "0:01:46.390314",
    "end": "2019-08-13 11:00:12.850181",
    "invocation": {
        "module_args": {
            "_raw_params": "bench init /home/frappe/frappe-bench --frappe-path https://github.com/frappe/frappe --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": "2019-08-13 10:58:26.459867",
    "stderr": "INFO:bench.utils:virtualenv -q env -p /usr/bin/python3\nINFO:bench.utils:env/bin/pip -q install --upgrade pip\nINFO:bench.utils:env/bin/pip -q install wheel\nINFO:bench.utils:env/bin/pip -q install six\nINFO:bench.utils:env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit\nINFO:bench.app:getting app frappe\nINFO:bench.utils:git clone https://github.com/frappe/frappe --branch version-12  --origin upstream\nCloning into 'frappe'...\nINFO:bench.app:installing frappe\nINFO:bench.utils:/home/frappe/frappe-bench/env/bin/pip install -q  -e /home/frappe/frappe-bench/apps/frappe \n    ERROR: Command errored out with exit status 1:\n     command: /home/frappe/frappe-bench/env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '\"'\"'/tmp/pip-install-2b7tmw27/psycopg2/setup.py'\"'\"'; __file__='\"'\"'/tmp/pip-install-2b7tmw27/psycopg2/setup.py'\"'\"';f=getattr(tokenize, '\"'\"'open'\"'\"', open)(__file__);code=f.read().replace('\"'\"'\\r\\n'\"'\"', '\"'\"'\\n'\"'\"');f.close();exec(compile(code, __file__, '\"'\"'exec'\"'\"'))' egg_info --egg-base pip-egg-info\n         cwd: /tmp/pip-install-2b7tmw27/psycopg2/\n    Complete output (23 lines):\n    running egg_info\n    creating pip-egg-info/psycopg2.egg-info\n    writing pip-egg-info/psycopg2.egg-info/PKG-INFO\n    writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt\n    writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt\n    writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'\n    \n    Error: pg_config executable not found.\n    \n    pg_config is required to build psycopg2 from source.  Please add the directory\n    containing pg_config to the $PATH or specify the full executable path with the\n    option:\n    \n        python setup.py build_ext --pg-config /path/to/pg_config build ...\n    \n    or with the pg_config option in 'setup.cfg'.\n    \n    If you prefer to avoid building psycopg2 from source, please install the PyPI\n    'psycopg2-binary' package instead.\n    \n    For further information please check the 'doc/src/install.rst' file (also at\n    <http://initd.org/psycopg/docs/install.html>).\n    \n    ----------------------------------------\nERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.\nTraceback (most recent call last):\n  File \"/usr/local/bin/bench\", line 11, in <module>\n    load_entry_point('bench', 'console_scripts', 'bench')()\n  File \"/home/frappe/.bench/bench/cli.py\", line 40, in cli\n    bench_command()\n  File \"/usr/lib/python3/dist-packages/click/core.py\", line 722, in __call__\n    return self.main(*args, **kwargs)\n  File \"/usr/lib/python3/dist-packages/click/core.py\", line 697, in main\n    rv = self.invoke(ctx)\n  File \"/usr/lib/python3/dist-packages/click/core.py\", line 1066, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n  File \"/usr/lib/python3/dist-packages/click/core.py\", line 895, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n  File \"/usr/lib/python3/dist-packages/click/core.py\", line 535, in invoke\n    return callback(*args, **kwargs)\n  File \"/home/frappe/.bench/bench/commands/make.py\", line 31, in init\n    python \t\t = python)\n  File \"/home/frappe/.bench/bench/utils.py\", line 75, in init\n    get_app(frappe_path, branch=frappe_branch, bench_path=path, build_asset_files=False, verbose=verbose)\n  File \"/home/frappe/.bench/bench/app.py\", line 136, in get_app\n    install_app(app=app_name, bench_path=bench_path, verbose=verbose)\n  File \"/home/frappe/.bench/bench/app.py\", line 172, in install_app\n    find_links=find_links))\n  File \"/home/frappe/.bench/bench/utils.py\", line 161, in exec_cmd\n    raise CommandFailedError(cmd)\nbench.utils.CommandFailedError: /home/frappe/frappe-bench/env/bin/pip install -q  -e /home/frappe/frappe-bench/apps/frappe ",
    "stderr_lines": [
        "INFO:bench.utils:virtualenv -q env -p /usr/bin/python3",
        "INFO:bench.utils:env/bin/pip -q install --upgrade pip",
        "INFO:bench.utils:env/bin/pip -q install wheel",
        "INFO:bench.utils:env/bin/pip -q install six",
        "INFO:bench.utils:env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit",
        "INFO:bench.app:getting app frappe",
        "INFO:bench.utils:git clone https://github.com/frappe/frappe --branch version-12  --origin upstream",
        "Cloning into 'frappe'...",
        "INFO:bench.app:installing frappe",
        "INFO:bench.utils:/home/frappe/frappe-bench/env/bin/pip install -q  -e /home/frappe/frappe-bench/apps/frappe ",
        "    ERROR: Command errored out with exit status 1:",
        "     command: /home/frappe/frappe-bench/env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '\"'\"'/tmp/pip-install-2b7tmw27/psycopg2/setup.py'\"'\"'; __file__='\"'\"'/tmp/pip-install-2b7tmw27/psycopg2/setup.py'\"'\"';f=getattr(tokenize, '\"'\"'open'\"'\"', open)(__file__);code=f.read().replace('\"'\"'\\r\\n'\"'\"', '\"'\"'\\n'\"'\"');f.close();exec(compile(code, __file__, '\"'\"'exec'\"'\"'))' egg_info --egg-base pip-egg-info",
        "         cwd: /tmp/pip-install-2b7tmw27/psycopg2/",
        "    Complete output (23 lines):",
        "    running egg_info",
        "    creating pip-egg-info/psycopg2.egg-info",
        "    writing pip-egg-info/psycopg2.egg-info/PKG-INFO",
        "    writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt",
        "    writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt",
        "    writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'",
        "    ",
        "    Error: pg_config executable not found.",
        "    ",
        "    pg_config is required to build psycopg2 from source.  Please add the directory",
        "    containing pg_config to the $PATH or specify the full executable path with the",
        "    option:",
        "    ",
        "        python setup.py build_ext --pg-config /path/to/pg_config build ...",
        "    ",
        "    or with the pg_config option in 'setup.cfg'.",
        "    ",
        "    If you prefer to avoid building psycopg2 from source, please install the PyPI",
        "    'psycopg2-binary' package instead.",
        "    ",
        "    For further information please check the 'doc/src/install.rst' file (also at",
        "    <http://initd.org/psycopg/docs/install.html>).",
        "    ",
        "    ----------------------------------------",
        "ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.",
        "Traceback (most recent call last):",
        "  File \"/usr/local/bin/bench\", line 11, in <module>",
        "    load_entry_point('bench', 'console_scripts', 'bench')()",
        "  File \"/home/frappe/.bench/bench/cli.py\", line 40, in cli",
        "    bench_command()",
        "  File \"/usr/lib/python3/dist-packages/click/core.py\", line 722, in __call__",
        "    return self.main(*args, **kwargs)",
        "  File \"/usr/lib/python3/dist-packages/click/core.py\", line 697, in main",
        "    rv = self.invoke(ctx)",
        "  File \"/usr/lib/python3/dist-packages/click/core.py\", line 1066, in invoke",
        "    return _process_result(sub_ctx.command.invoke(sub_ctx))",
        "  File \"/usr/lib/python3/dist-packages/click/core.py\", line 895, in invoke",
        "    return ctx.invoke(self.callback, **ctx.params)",
        "  File \"/usr/lib/python3/dist-packages/click/core.py\", line 535, in invoke",
        "    return callback(*args, **kwargs)",
        "  File \"/home/frappe/.bench/bench/commands/make.py\", line 31, in init",
        "    python \t\t = python)",
        "  File \"/home/frappe/.bench/bench/utils.py\", line 75, in init",
        "    get_app(frappe_path, branch=frappe_branch, bench_path=path, build_asset_files=False, verbose=verbose)",
        "  File \"/home/frappe/.bench/bench/app.py\", line 136, in get_app",
        "    install_app(app=app_name, bench_path=bench_path, verbose=verbose)",
        "  File \"/home/frappe/.bench/bench/app.py\", line 172, in install_app",
        "    find_links=find_links))",
        "  File \"/home/frappe/.bench/bench/utils.py\", line 161, in exec_cmd",
        "    raise CommandFailedError(cmd)",
        "bench.utils.CommandFailedError: /home/frappe/frappe-bench/env/bin/pip install -q  -e /home/frappe/frappe-bench/apps/frappe "
    ],
    "stdout": "Already using interpreter /usr/bin/python3\ninstalling frappe",
    "stdout_lines": [
        "Already using interpreter /usr/bin/python3",
        "installing frappe"
    ]
}

PLAY RECAP *********************************************************************
localhost                  : ok=72   changed=46   unreachable=0    failed=1    skipped=47   rescued=0    ignored=0

Traceback (most recent call last):
  File "install.py", line 413, in <module>
    install_bench(args)
  File "install.py", line 135, in install_bench
    run_playbook('site.yml', sudo=True, extra_vars=extra_vars)
  File "install.py", line 327, in run_playbook
    success = subprocess.check_call(args, cwd=os.path.join(cwd, 'playbooks'))
  File "/usr/lib/python2.7/subprocess.py", line 190, 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
root@ip-172-31-8-213:/home#

Got past the last error with apt-get install libpq-dev but then there’s another one:

TASK [bench : Get the ERPNext app] *********************************************
task path: /tmp/.bench/playbooks/roles/bench/tasks/setup_erpnext.yml:6
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c 'echo ~root && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /var/tmp/ansible-tmp-1565698645.4408746-175706828432683 `" && echo ansible-tmp-1565698645.4408746-175706828432683="` echo /var/tmp/ansible-tmp-1565698645.4408746-175706828432683 `" ) && sleep 0'
Using module file /usr/local/lib/python3.6/dist-packages/ansible/modules/commands/command.py
<127.0.0.1> PUT /root/.ansible/tmp/ansible-local-14270o2rsh8k4/tmpdmqfx5v5 TO /var/tmp/ansible-tmp-1565698645.4408746-175706828432683/AnsiballZ_command.py
<127.0.0.1> EXEC /bin/sh -c 'setfacl -m u:frappe:r-x /var/tmp/ansible-tmp-1565698645.4408746-175706828432683/ /var/tmp/ansible-tmp-1565698645.4408746-175706828432683/AnsiballZ_command.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -n  -u frappe /bin/sh -c '"'"'echo BECOME-SUCCESS-dklfzzrvodtoaijiyyntjvmbsqajaxmv ; /usr/bin/python3 /var/tmp/ansible-tmp-1565698645.4408746-175706828432683/AnsiballZ_command.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /var/tmp/ansible-tmp-1565698645.4408746-175706828432683/ > /dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
    "changed": true,
    "cmd": [
        "bench",
        "get-app",
        "erpnext",
        "https://github.com/frappe/erpnext",
        "--branch",
        "version-12"
    ],
    "delta": "0:00:09.309409",
    "end": "2019-08-13 12:17:35.113513",
    "invocation": {
        "module_args": {
            "_raw_params": "bench get-app erpnext https://github.com/frappe/erpnext --branch version-12",
            "_uses_shell": false,
            "argv": null,
            "chdir": "/home/frappe/frappe-bench",
            "creates": "/home/frappe/frappe-bench/apps/erpnext",
            "executable": null,
            "removes": null,
            "stdin": null,
            "stdin_add_newline": true,
            "strip_empty_ends": true,
            "warn": true
        }
    },
    "msg": "non-zero return code",
    "rc": 1,
    "start": "2019-08-13 12:17:25.804104",
    "stderr": "INFO:bench.app:getting app erpnext\nINFO:bench.utils:git clone https://github.com/frappe/erpnext --branch version-12 --depth 1 --origin upstream\nCloning into 'erpnext'...\nChecking out files:  98% (5772/5865)   \rChecking out files:  99% (5807/5865)   \rChecking out files: 100% (5865/5865)   \rChecking out files: 100% (5865/5865), done.\nINFO:bench.app:installing erpnext\nINFO:bench.utils:./env/bin/pip install -q  -e ./apps/erpnext \n    ERROR: Command errored out with exit status 1:\n     command: /home/frappe/frappe-bench/env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '\"'\"'/tmp/pip-install-0qwm4t9c/frappe/setup.py'\"'\"'; __file__='\"'\"'/tmp/pip-install-0qwm4t9c/frappe/setup.py'\"'\"';f=getattr(tokenize, '\"'\"'open'\"'\"', open)(__file__);code=f.read().replace('\"'\"'\\r\\n'\"'\"', '\"'\"'\\n'\"'\"');f.close();exec(compile(code, __file__, '\"'\"'exec'\"'\"'))' egg_info --egg-base pip-egg-info\n         cwd: /tmp/pip-install-0qwm4t9c/frappe/\n    Complete output (12 lines):\n    Traceback (most recent call last):\n      File \"/tmp/pip-install-0qwm4t9c/frappe/setup.py\", line 8, in <module>\n        import testfm\n    ModuleNotFoundError: No module named 'testfm'\n    \n    During handling of the above exception, another exception occurred:\n    \n    Traceback (most recent call last):\n      File \"<string>\", line 1, in <module>\n      File \"/tmp/pip-install-0qwm4t9c/frappe/setup.py\", line 10, in <module>\n        raise LookupError(\"You must have test.fm >= 1.0.4 installed before (https://github.com/grafos-ml/frappe)\")\n    LookupError: You must have test.fm >= 1.0.4 installed before (https://github.com/grafos-ml/frappe)\n    ----------------------------------------\nERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.\nTraceback (most recent call last):\n  File \"/usr/local/bin/bench\", line 11, in <module>\n    load_entry_point('bench', 'console_scripts', 'bench')()\n  File \"/home/frappe/.bench/bench/cli.py\", line 40, in cli\n    bench_command()\n  File \"/usr/lib/python3/dist-packages/click/core.py\", line 722, in __call__\n    return self.main(*args, **kwargs)\n  File \"/usr/lib/python3/dist-packages/click/core.py\", line 697, in main\n    rv = self.invoke(ctx)\n  File \"/usr/lib/python3/dist-packages/click/core.py\", line 1066, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n  File \"/usr/lib/python3/dist-packages/click/core.py\", line 895, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n  File \"/usr/lib/python3/dist-packages/click/core.py\", line 535, in invoke\n    return callback(*args, **kwargs)\n  File \"/home/frappe/.bench/bench/commands/make.py\", line 41, in get_app\n    get_app(git_url, branch=branch)\n  File \"/home/frappe/.bench/bench/app.py\", line 136, in get_app\n    install_app(app=app_name, bench_path=bench_path, verbose=verbose)\n  File \"/home/frappe/.bench/bench/app.py\", line 172, in install_app\n    find_links=find_links))\n  File \"/home/frappe/.bench/bench/utils.py\", line 161, in exec_cmd\n    raise CommandFailedError(cmd)\nbench.utils.CommandFailedError: ./env/bin/pip install -q  -e ./apps/erpnext ",
    "stderr_lines": [
        "INFO:bench.app:getting app erpnext",
        "INFO:bench.utils:git clone https://github.com/frappe/erpnext --branch version-12 --depth 1 --origin upstream",
        "Cloning into 'erpnext'...",
        "Checking out files:  98% (5772/5865)   ",
        "Checking out files:  99% (5807/5865)   ",
        "Checking out files: 100% (5865/5865)   ",
        "Checking out files: 100% (5865/5865), done.",
        "INFO:bench.app:installing erpnext",
        "INFO:bench.utils:./env/bin/pip install -q  -e ./apps/erpnext ",
        "    ERROR: Command errored out with exit status 1:",
        "     command: /home/frappe/frappe-bench/env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '\"'\"'/tmp/pip-install-0qwm4t9c/frappe/setup.py'\"'\"'; __file__='\"'\"'/tmp/pip-install-0qwm4t9c/frappe/setup.py'\"'\"';f=getattr(tokenize, '\"'\"'open'\"'\"', open)(__file__);code=f.read().replace('\"'\"'\\r\\n'\"'\"', '\"'\"'\\n'\"'\"');f.close();exec(compile(code, __file__, '\"'\"'exec'\"'\"'))' egg_info --egg-base pip-egg-info",
        "         cwd: /tmp/pip-install-0qwm4t9c/frappe/",
        "    Complete output (12 lines):",
        "    Traceback (most recent call last):",
        "      File \"/tmp/pip-install-0qwm4t9c/frappe/setup.py\", line 8, in <module>",
        "        import testfm",
        "    ModuleNotFoundError: No module named 'testfm'",
        "    ",
        "    During handling of the above exception, another exception occurred:",
        "    ",
        "    Traceback (most recent call last):",
        "      File \"<string>\", line 1, in <module>",
        "      File \"/tmp/pip-install-0qwm4t9c/frappe/setup.py\", line 10, in <module>",
        "        raise LookupError(\"You must have test.fm >= 1.0.4 installed before (https://github.com/grafos-ml/frappe)\")",
        "    LookupError: You must have test.fm >= 1.0.4 installed before (https://github.com/grafos-ml/frappe)",
        "    ----------------------------------------",
        "ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.",
        "Traceback (most recent call last):",
        "  File \"/usr/local/bin/bench\", line 11, in <module>",
        "    load_entry_point('bench', 'console_scripts', 'bench')()",
        "  File \"/home/frappe/.bench/bench/cli.py\", line 40, in cli",
        "    bench_command()",
        "  File \"/usr/lib/python3/dist-packages/click/core.py\", line 722, in __call__",
        "    return self.main(*args, **kwargs)",
        "  File \"/usr/lib/python3/dist-packages/click/core.py\", line 697, in main",
        "    rv = self.invoke(ctx)",
        "  File \"/usr/lib/python3/dist-packages/click/core.py\", line 1066, in invoke",
        "    return _process_result(sub_ctx.command.invoke(sub_ctx))",
        "  File \"/usr/lib/python3/dist-packages/click/core.py\", line 895, in invoke",
        "    return ctx.invoke(self.callback, **ctx.params)",
        "  File \"/usr/lib/python3/dist-packages/click/core.py\", line 535, in invoke",
        "    return callback(*args, **kwargs)",
        "  File \"/home/frappe/.bench/bench/commands/make.py\", line 41, in get_app",
        "    get_app(git_url, branch=branch)",
        "  File \"/home/frappe/.bench/bench/app.py\", line 136, in get_app",
        "    install_app(app=app_name, bench_path=bench_path, verbose=verbose)",
        "  File \"/home/frappe/.bench/bench/app.py\", line 172, in install_app",
        "    find_links=find_links))",
        "  File \"/home/frappe/.bench/bench/utils.py\", line 161, in exec_cmd",
        "    raise CommandFailedError(cmd)",
        "bench.utils.CommandFailedError: ./env/bin/pip install -q  -e ./apps/erpnext "
    ],
    "stdout": "/home/frappe/frappe-bench/env/bin/python: Error while finding module specification for 'frappe.utils.bench_helper' (ModuleNotFoundError: No module named 'frappe')\n\ninstalling erpnext",
    "stdout_lines": [
        "/home/frappe/frappe-bench/env/bin/python: Error while finding module specification for 'frappe.utils.bench_helper' (ModuleNotFoundError: No module named 'frappe')",
        "",
        "installing erpnext"
    ]
}

PLAY RECAP *********************************************************************
localhost                  : ok=72   changed=16   unreachable=0    failed=1    skipped=54   rescued=0    ignored=0

Traceback (most recent call last):
  File "install.py", line 413, in <module>
    install_bench(args)
  File "install.py", line 135, in install_bench
    run_playbook('site.yml', sudo=True, extra_vars=extra_vars)
  File "install.py", line 327, in run_playbook
    success = subprocess.check_call(args, cwd=os.path.join(cwd, 'playbooks'))
  File "/usr/lib/python2.7/subprocess.py", line 190, 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
root@ip-172-31-8-213:/home#

I got the installation successfully completed by rebooting the instance and running the install again. I also increased the RAM to 4GB as the previous 2GB allocation was running at 100% during the installation

Cheers!