Frape-bench init failed centos7

I’m trying to install erpnext on centos 7 server and it fails on frape-bench init. I have installed all the dependencies as far as I know. The log says:

INFO:bench.utils:virtualenv -q env -p /usr/bin/python2

Already using interpreter /usr/bin/python2

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+ app frappe

INFO:bench.utils:git clone   --origin upstream

Cloning into 'frappe'...

remote: Counting objects: 140735, done.

remote: Compressing objects: 100% (21/21), done.

remote: Total 140735 (delta 9), reused 20 (delta 7), pack-reused 140707

Receiving objects: 100% (140735/140735), 114.21 MiB | 11.09 MiB/s, done.

Resolving deltas: 100% (106958/106958), done.

('installing', u'frappe') frappe

INFO:bench.utils:frappe-bench/env/bin/pip install -q  -e frappe-bench/apps/frappe --no-cache-dir
Command "/home/admin/domains/ -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-MVWn32/mysqlclient/';f=getattr(tokenize, 'open', open)(__file__);'\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-Z7rA0G-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/admin/domains/" failed with error code 1 in /tmp/pip-build-MVWn32/mysqlclient/

Traceback (most recent call last):

  File "/usr/bin/bench", line 9, in <module>
    load_entry_point('bench==4.1.0', 'console_scripts', 'bench')()

  File "/home/admin/domains/", line 40, in cli

  File "/usr/lib64/python2.7/site-packages/click/", line 722, in __call__
    return self.main(*args, **kwargs)

  File "/usr/lib64/python2.7/site-packages/click/", line 697, in main
    rv = self.invoke(ctx)

  File "/usr/lib64/python2.7/site-packages/click/", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))

  File "/usr/lib64/python2.7/site-packages/click/", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)

  File "/usr/lib64/python2.7/site-packages/click/", line 535, in invoke
    return callback(*args, **kwargs)

  File "/home/admin/domains/", line 21, in init

    verbose=verbose, clone_from=clone_from, skip_bench_mkdir=skip_bench_mkdir, skip_redis_config_generation=skip_redis_config_generation)

  File "/home/admin/domains/", line 64, in init
    get_app(frappe_path, branch=frappe_branch, bench_path=path, build_asset_files=False, verbose=verbose)

  File "/home/admin/domains/", line 76, in get_app
    install_app(app=app_name, bench_path=bench_path, verbose=verbose)

  File "/home/admin/domains/", line 107, in install_app

  File "/home/admin/domains/", line 140, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: frappe-bench/env/bin/pip install -q  -e frappe-bench/apps/frappe --no-cache-dir

I’m going clueless as I seem to have installed all the dependencies. Can someone guide me please?

check the mysql is running or not


MariaDB? Yes. its installed and the service is running.

please try to search on google


I just tried to install mysqlclient from frape-bench using env/bin/pip but it said permission denied for gcc. I tried to init frape-bench fresh as sudo but it denied to run as sudo. pip installed mysqlclient as suo though. But I didnt know where to continue from there as the init obviously failed in the middle due to mysqlclient.

Finally I ran the automated install script but the error is strange as I did run it as sudo. Below is the log.

fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["cp", "-R", "/tmp/.bench", "/home/root/.bench"], "delta": "0:00:00.006088", "end": "2017-09-19 20:16:39.405361", "failed": true, "msg": "non-zero return code", "rc": 1, "start": "2017-09-19 20:16:39.399273", "stderr": "cp: cannot create directory ‘/home/root/.bench’: No such file or directory", "stderr_lines": ["cp: cannot create directory ‘/home/root/.bench’: No such file or directory"], "stdout": "", "stdout_lines": []}
        to retry, use: --limit @/tmp/.bench/playbooks/production/install.retry

PLAY RECAP *********************************************************************
localhost                  : ok=21   changed=10   unreachable=0    failed=1

try to install the mysql manually


I do have mysql mariadb 10.1.26 installed and running successfully. I dont understand how frape isnt able to see/use it. Also, like I said previously, manually installing python mysqlclient from within frape-bench using pip works. But it only works as root/sudo. If run as normal user, gcc throws permission denied.

Here it is. Mysql works good and is installed manually already. Its the script which fails while installing mysqlclient strangely. Though goes through if installed as sudo (2nd post since new user)


Here is the mysqlclient install ss using sudo