ERROR bench init. Please Help

Please help me. What should I do? I got error when run bench init frappe-bench.

OS: Ubuntu 14.04
MariaDB: 10.1
Python: 2.7

$ which python
/usr/bin/python
$ python --version
Python 2.7.6
$ bench init frappe-bench
Already using interpreter /usr/bin/python
/home/putra/frappe-bench/env/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
/home/putra/frappe-bench/env/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
/home/putra/frappe-bench/env/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
/home/putra/frappe-bench/env/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Command "/home/putra/frappe-bench/env/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-CFAHSm-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-D54emz-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/putra/frappe-bench/env/include/site/python2.7/MySQL-python" failed with error code 1 in /tmp/pip-CFAHSm-build
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench==0.0.0', 'console_scripts', 'bench')()
  File "/home/putra/bench-repo/bench/cli.py", line 60, in cli
    bench()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/putra/bench-repo/bench/cli.py", line 166, in init
    no_auto_update=no_auto_update, frappe_path=frappe_path, frappe_branch=frappe_branch, verbose=verbose)
  File "/home/putra/bench-repo/bench/utils.py", line 64, in init
    setup_env(bench=path)
  File "/home/putra/bench-repo/bench/utils.py", line 111, in setup_env
    exec_cmd('./env/bin/pip -q install https://github.com/frappe/MySQLdb1/archive/MySQLdb-1.2.5-patched.tar.gz', cwd=bench)
  File "/home/putra/bench-repo/bench/utils.py", line 105, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: ./env/bin/pip -q install https://github.com/frappe/MySQLdb1/archive/MySQLdb-1.2.5-patched.tar.gz
$ dpkg -l mariadb-*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                             Version               Architecture          Description
+++-================================-=====================-=====================-=====================================================================
un  mariadb-client                   <none>                <none>                (no description available)
un  mariadb-client-10.0              <none>                <none>                (no description available)
ii  mariadb-client-10.1              10.1.10+maria-1~trust amd64                 MariaDB database client binaries
un  mariadb-client-5.1               <none>                <none>                (no description available)
un  mariadb-client-5.2               <none>                <none>                (no description available)
un  mariadb-client-5.3               <none>                <none>                (no description available)
un  mariadb-client-5.5               <none>                <none>                (no description available)
un  mariadb-client-core-10.0         <none>                <none>                (no description available)
ii  mariadb-client-core-10.1         10.1.10+maria-1~trust amd64                 MariaDB database core client binaries
un  mariadb-client-core-5.1          <none>                <none>                (no description available)
un  mariadb-client-core-5.2          <none>                <none>                (no description available)
un  mariadb-client-core-5.3          <none>                <none>                (no description available)
un  mariadb-client-core-5.5          <none>                <none>                (no description available)
ii  mariadb-common                   10.1.10+maria-1~trust all                   MariaDB database common files (e.g. /etc/mysql/conf.d/mariadb.cnf)
un  mariadb-galera-server-10.0       <none>                <none>                (no description available)
un  mariadb-galera-server-5.5        <none>                <none>                (no description available)
ii  mariadb-server                   10.1.10+maria-1~trust all                   MariaDB database server (metapackage depending on the latest version)
un  mariadb-server-10.0              <none>                <none>                (no description available)
ii  mariadb-server-10.1              10.1.10+maria-1~trust amd64                 MariaDB database server binaries
un  mariadb-server-5.1               <none>                <none>                (no description available)
un  mariadb-server-5.2               <none>                <none>                (no description available)
un  mariadb-server-5.3               <none>                <none>                (no description available)
un  mariadb-server-5.5               <none>                <none>                (no description available)
un  mariadb-server-core-10.0         <none>                <none>                (no description available)
ii  mariadb-server-core-10.1         10.1.10+maria-1~trust amd64                 MariaDB database core server files
un  mariadb-server-core-5.1          <none>                <none>                (no description available)
un  mariadb-server-core-5.2          <none>                <none>                (no description available)
un  mariadb-server-core-5.3          <none>                <none>                (no description available)
un  mariadb-server-core-5.5          <none>                <none>                (no description available)
un  mariadb-test                     <none>                <none>                (no description available)
un  mariadb-tokudb-engine-10.0       <none>                <none>                (no description available)
un  mariadb-tokudb-engine-5.5        <none>                <none>                (no description available)

If you are using debian, use

sudo apt-get install libmariadbclient-dev

and then re-install setup

I think I already have installed libmariadbclient-dev. But I’ll check back when at home.

Make sure you either have > 1gb ram or have swap > 1gb. I think this ram is needed for compiling mariadb client.

Thanks @anand. I have RAM > 1GB. I run bench init from my PC.

Try after setting up swap of 2gb or more

Best,
Anand Doshi

ERPNext

Thanks @anand. Yes, my PC is not set for swap. I will set the swap when at home.

HI @all, I still get the same error. Now I tried to install from DigitalOcean

This is a steps that has been done :

  • Create new DigitalOcean droplet with 1GB RAM
  • Set swap 4GB
  • Install Redis
  • Install MariaDB 10.1 from Download MariaDB Server - MariaDB.org
  • Run sudo apt-get install libmariadbclient-dev
  • Run git clone https://github.com/frappe/bench bench-repo
  • Run sudo pip install -e bench-repo
  • Run bench init frappe-bench and got Error :
    Command "/home/user1/frappe-bench/env/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-6elJbZ-build/setup.py';exec(compile(getattr(tokenize, 'open', open) (__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-5svc6j-record/install-record.txt --single-version-externally-managed --compile - -install-headers /home/user1/frappe-bench/env/include/site/python2.7/MySQL-python" failed with error code 1 in /tmp/pip-6elJbZ-build

####$ bench init frappe-bench

$ bench init frappe-bench
Already using interpreter /usr/bin/python
/home/user1/frappe-bench/env/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object  is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.re adthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
/home/user1/frappe-bench/env/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object  is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.re adthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
/home/user1/frappe-bench/env/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object  is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.re adthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
/home/user1/frappe-bench/env/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object  is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.re adthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Command "/home/user1/frappe-bench/env/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-6elJbZ-build/setup.py';exec(compile(getattr(tokenize, 'open', open) (__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-5svc6j-record/install-record.txt --single-version-externally-managed --compile - -install-headers /home/user1/frappe-bench/env/include/site/python2.7/MySQL-python" failed with error code 1 in /tmp/pip-6elJbZ-build
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 9, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/user1/bench-repo/bench/cli.py", line 60, in cli
    bench()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/user1/bench-repo/bench/cli.py", line 166, in init
    no_auto_update=no_auto_update, frappe_path=frappe_path, frappe_branch=frappe_branch, verbose=verbose)
  File "/home/user1/bench-repo/bench/utils.py", line 64, in init
    setup_env(bench=path)
  File "/home/user1/bench-repo/bench/utils.py", line 111, in setup_env
    exec_cmd('./env/bin/pip -q install https://github.com/frappe/MySQLdb1/archive/MySQLdb-1.2.5-patched.tar.gz', cwd=bench)
  File "/home/user1/bench-repo/bench/utils.py", line 105, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: ./env/bin/pip -q install https://github.com/frappe/MySQLdb1/archive/MySQLdb-1.2.5-patched.tar.gz

####$ dpkg -l mariadb-

$ dpkg -l mariadb-*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                 Version                 Architecture            Description
+++-====================================-=======================-=======================-=============================================================================
un  mariadb-client                       <none>                  <none>                  (no description available)
un  mariadb-client-10.0                  <none>                  <none>                  (no description available)
ii  mariadb-client-10.1                  10.1.10+maria-1~trusty  amd64                   MariaDB database client binaries
un  mariadb-client-5.1                   <none>                  <none>                  (no description available)
un  mariadb-client-5.2                   <none>                  <none>                  (no description available)
un  mariadb-client-5.3                   <none>                  <none>                  (no description available)
un  mariadb-client-5.5                   <none>                  <none>                  (no description available)
un  mariadb-client-core-10.0             <none>                  <none>                  (no description available)
ii  mariadb-client-core-10.1             10.1.10+maria-1~trusty  amd64                   MariaDB database core client binaries
un  mariadb-client-core-5.1              <none>                  <none>                  (no description available)
un  mariadb-client-core-5.2              <none>                  <none>                  (no description available)
un  mariadb-client-core-5.3              <none>                  <none>                  (no description available)
un  mariadb-client-core-5.5              <none>                  <none>                  (no description available)
ii  mariadb-common                       10.1.10+maria-1~trusty  all                     MariaDB database common files (e.g. /etc/mysql/conf.d/mariadb.cnf)
un  mariadb-galera-server-10.0           <none>                  <none>                  (no description available)
un  mariadb-galera-server-5.5            <none>                  <none>                  (no description available)
ii  mariadb-server                       10.1.10+maria-1~trusty  all                     MariaDB database server (metapackage depending on the latest version)
un  mariadb-server-10.0                  <none>                  <none>                  (no description available)
ii  mariadb-server-10.1                  10.1.10+maria-1~trusty  amd64                   MariaDB database server binaries
un  mariadb-server-5.1                   <none>                  <none>                  (no description available)
un  mariadb-server-5.2                   <none>                  <none>                  (no description available)
un  mariadb-server-5.3                   <none>                  <none>                  (no description available)
un  mariadb-server-5.5                   <none>                  <none>                  (no description available)
un  mariadb-server-core-10.0             <none>                  <none>                  (no description available)
ii  mariadb-server-core-10.1             10.1.10+maria-1~trusty  amd64                   MariaDB database core server files
un  mariadb-server-core-5.1              <none>                  <none>                  (no description available)
un  mariadb-server-core-5.2              <none>                  <none>                  (no description available)
un  mariadb-server-core-5.3              <none>                  <none>                  (no description available)
un  mariadb-server-core-5.5              <none>                  <none>                  (no description available)
un  mariadb-test                         <none>                  <none>                  (no description available)
un  mariadb-tokudb-engine-10.0           <none>                  <none>                  (no description available)
un  mariadb-tokudb-engine-5.5            <none>                  <none>                  (no description available)

####$ dpkg -l libmariadbclient-dev

$ dpkg -l libmariadbclient-dev
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                 Version                 Architecture            Description
+++-====================================-=======================-=======================-=============================================================================
ii  libmariadbclient-dev                 10.1.10+maria-1~trusty  amd64                   MariaDB database development files

@agusputra check if mariadb is installed by running mysql and check its version

also check dpkg -s libmariadbclient-dev

Thanks @anand, I’ll check it later.

@anand I have checked it

$ mysql --version
mysql  Ver 15.1 Distrib 10.1.10-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
$ dpkg -s libmariadbclient-dev
Package: libmariadbclient-dev
Status: install ok installed
Priority: optional
Section: libdevel
Installed-Size: 8348
Maintainer: MariaDB Developers <maria-developers@lists.launchpad.net>
Architecture: amd64
Source: mariadb-10.1
Version: 10.1.10+maria-1~trusty
Replaces: libmariadbclient16-dev, libmysqlclient16-dev
Provides: libmysqlclient-dev
Depends: libmariadbclient18 (>= 10.1.10+maria-1~trusty), zlib1g-dev
Conflicts: libmariadbclient16-dev, libmysqlclient-dev, libmysqlclient10-dev, libmysqlclient12-dev, libmysqlclient14-dev, libmysqlclient15-dev, libmysqlclient16-dev
Description: MariaDB database development files
 MariaDB is a fast, stable and true multi-user, multi-threaded SQL database
 server. SQL (Structured Query Language) is the most popular database query
 language in the world. The main goals of MariaDB are speed, robustness and
 ease of use.
 .
 This package includes development libraries and header files.
Homepage: http://mariadb.org/

Hi @anand do you have any clue what should I do ?

  1. Go to frappe-bench
  2. run ./env/bin/pip install https://github.com/frappe/MySQLdb1/archive/MySQLdb-1.2.5-patched.tar.gz
  3. what’s the error?

@anand I tried the easy way (run setup_frappe.sh). And after that bench init run successfully.

I do not know where the mistake. There may be something done in setup_frappe.sh but no in manual way.

Thanks for your help :slight_smile: