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+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.git   --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')

INFO:bench.app:installing frappe

INFO:bench.utils:frappe-bench/env/bin/pip install -q  -e frappe-bench/apps/frappe --no-cache-dir
Command "/home/admin/domains/erp.chennaielectrikkals.com/frappe-bench/env/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-MVWn32/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\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/erp.chennaielectrikkals.com/frappe-bench/env/include/site/python2.7/mysqlclient" 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/erp.chennaielectrikkals.com/bench-repo/bench/cli.py", line 40, in cli
    bench_command()

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

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

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

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

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

  File "/home/admin/domains/erp.chennaielectrikkals.com/bench-repo/bench/commands/make.py", 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/erp.chennaielectrikkals.com/bench-repo/bench/utils.py", line 64, in init
    get_app(frappe_path, branch=frappe_branch, bench_path=path, build_asset_files=False, verbose=verbose)

  File "/home/admin/domains/erp.chennaielectrikkals.com/bench-repo/bench/app.py", line 76, in get_app
    install_app(app=app_name, bench_path=bench_path, verbose=verbose)

  File "/home/admin/domains/erp.chennaielectrikkals.com/bench-repo/bench/app.py", line 107, in install_app
    find_links=find_links))

  File "/home/admin/domains/erp.chennaielectrikkals.com/bench-repo/bench/utils.py", 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

Thanks

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

please try to search on google

Thanks

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

Thanks

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)

Capture

Here is the mysqlclient install ss using sudo
Capture2