[Error: Bench Update] Command "python setup.py egg_info" failed with error code 1 in /home/frappe/frappe-bench/env/src/mysqlclient/

I have installed MariaDB 10.2.10. When i do bench update i am getting Command "python setup.py egg_info" failed with error code 1 in /home/frappe/frappe-bench/env/src/mysqlclient/ error. If anyone tried to install MariaDB 10.2 and performed bench update? Any help / pointers would very much appreciated.

Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages
INFO:bench.utils:./env/bin/pip install -q -r /home/frappe/bench-repo/requirements.txt
INFO:bench.utils:./env/bin/pip install -q -r ./apps/erpnext/requirements.txt
INFO:bench.utils:./env/bin/pip install -q -r ./apps/frappe/requirements.txt
Command “python setup.py egg_info” failed with error code 1 in /home/frappe/frappe-bench/env/src/mysqlclient/
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/bench-repo/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/bench-repo/bench/commands/update.py”, line 58, in update
_update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, force=force, reset=reset)
File “/home/frappe/bench-repo/bench/commands/update.py”, line 74, in _update
update_requirements(bench_path=bench_path)
File “/home/frappe/bench-repo/bench/utils.py”, line 410, in update_requirements
install_requirements(pip, req_file)
File “/home/frappe/bench-repo/bench/utils.py”, line 446, in install_requirements
exec_cmd(“{pip} install -q -r {req_file}”.format(pip=pip, req_file=req_file))
File “/home/frappe/bench-repo/bench/utils.py”, line 140, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: ./env/bin/pip install -q -r ./apps/frappe/requirements.txt
frappe@erpnext:~/frappe-bench$

This article will probably help (even if your install isn’t a mac) - looks like you have a pip python-myslq error/problem

I have tried what was suggested in above post but it doesn’t work either.

which OS are you using? This article may offer some more insights.

I am using Ubuntu 14.04 and Python 2.7.6 and tried couple of results from google but none of them worked either. I tried the above post but interestingly, i don’t see mysql_config when i execute which mysql_config.

Executing pip install mysqlclient in side ./env/bin/pip install mysqlclient tells requirement is satisfied.

When i execute pip install mysqlclient without ./env/bin/pip install mysqlclient it throws this error

frappe@erpnext:~/frappe-bench$ pip install mysqlclient
Downloading/unpacking mysqlclient
Downloading mysqlclient-1.3.12.tar.gz (89kB): 89kB downloaded
Running setup.py (path:/tmp/pip_build_frappe/mysqlclient/setup.py) egg_info for package mysqlclient
sh: 1: mysql_config: not found
Traceback (most recent call last):
File “”, line 17, in
File “/tmp/pip_build_frappe/mysqlclient/setup.py”, line 17, in
metadata, options = get_config()
File “setup_posix.py”, line 44, in get_config
libs = mysql_config(“libs_r”)
File “setup_posix.py”, line 26, in mysql_config
raise EnvironmentError(“%s not found” % (mysql_config.path,))
EnvironmentError: mysql_config not found
Complete output from command python setup.py egg_info:
sh: 1: mysql_config: not found
Traceback (most recent call last):
File “”, line 17, in
File “/tmp/pip_build_frappe/mysqlclient/setup.py”, line 17, in
metadata, options = get_config()
File “setup_posix.py”, line 44, in get_config
libs = mysql_config(“libs_r”)
File “setup_posix.py”, line 26, in mysql_config
raise EnvironmentError(“%s not found” % (mysql_config.path,))
EnvironmentError: mysql_config not found


Cleaning up…
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_frappe/mysqlclient
Storing debug log for failure in /home/frappe/.pip/pip.log

Looking at /home/frappe/.pip/pip.log shows something as below

Traceback (most recent call last):
  File "<string>", line 17, in <module>
  File "/tmp/pip_build_frappe/mysqlclient/setup.py", line 17, in <module>
    metadata, options = get_config()
  File "setup_posix.py", line 44, in get_config
    libs = mysql_config("libs_r")
  File "setup_posix.py", line 26, in mysql_config
    raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found

Cleaning up...
  Removing temporary dir /tmp/pip_build_frappe...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_frappe/mysqlclient
Exception information:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1230, in prepare_files
    req_to_install.run_egg_info()
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 326, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/usr/lib/python2.7/dist-packages/pip/util.py", line 715, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_frappe/mysqlclient

Crux is of this issue seems like mysql_config not created. Tried every possible solution, reinstalled MariaDB twice but no luck yet :frowning:

NOTE: When i do bench mysql, it is getting connected. Getting issue only during bench update.

do you have all the libraries installed on the OS
sudo apt-get install libmariadbclient-dev

Maybe get a list of all mysql*/maria* libraries you have

This is what i get when i execute sudo apt-get install libmariadbclient-dev

frappe@erpnext:~/frappe-bench$ sudo apt-get install libmariadbclient-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libmariadbclient-dev : Depends: libmariadbclient18 (= 5.5.57-1ubuntu0.14.04.1)
E: Unable to correct problems, you have held broken packages.
frappe@erpnext:~/frappe-bench$

Eventhough I have installed libmariadbclient18.

You can ask technical queries on discuss.frappe.io, request you to move this to that forum.