I've been following the instructions at https://dev.mysql.com/doc/connector-python/en/connector-python-installation-source.html for installing from source on Unix systems. I have the mysql, mysql-devel, and mysql-server packages installed on the server as well. I need the c extensions, and that configuration option is what is causing the error (if I install it without the c extensions it installs fine). The command I issue is "python3.6 setup.py install --with-mysql-capi=/usr/lib64/mysql/mysql_config" but it just throws the following error:
running install
Installing MySQL C Extension
running build
running build_py
running build_ext
# Python architecture: 64-bit
# Python ARCH_64BIT: True
# Looking mysqlclient_lib at path: -rdynamic/lib-L/usr/lib64/mysql*
Traceback (most recent call last):
File "setup.py", line 64, in <module>
ext_modules=setupinfo.extensions,
File "/usr/lib64/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib64/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/mysql-connector-python-2.1.7/lib/cpy_distutils.py", line 665, in run
install.run(self)
File "/usr/lib64/python3.6/distutils/command/install.py", line 545, in run
self.run_command('build')
File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib64/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python3.6/distutils/dist.py", line 973, in run_command
cmd_obj.ensure_finalized()
File "/usr/lib64/python3.6/distutils/cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "/mysql-connector-python-2.1.7/lib/cpy_distutils.py", line 423, in finalize_options
self._finalize_connector_c(self.with_mysql_capi)
File "/mysql-connector-python-2.1.7/lib/cpy_distutils.py", line 374, in _finalize_connector_c
myc_info = get_mysql_config_info(mysql_config)
File "/mysql-connector-python-2.1.7/lib/cpy_distutils.py", line 226, in get_mysql_config_info
log.debug("# mysqlclient_lib: {0}".format(mysqlclient_libs[-1]))
IndexError: list index out of range
running install
Installing MySQL C Extension
running build
running build_py
running build_ext
# Python architecture: 64-bit
# Python ARCH_64BIT: True
# Looking mysqlclient_lib at path: -rdynamic/lib-L/usr/lib64/mysql*
Traceback (most recent call last):
File "setup.py", line 64, in <module>
ext_modules=setupinfo.extensions,
File "/usr/lib64/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib64/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/mysql-connector-python-2.1.7/lib/cpy_distutils.py", line 665, in run
install.run(self)
File "/usr/lib64/python3.6/distutils/command/install.py", line 545, in run
self.run_command('build')
File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib64/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib64/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python3.6/distutils/dist.py", line 973, in run_command
cmd_obj.ensure_finalized()
File "/usr/lib64/python3.6/distutils/cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "/mysql-connector-python-2.1.7/lib/cpy_distutils.py", line 423, in finalize_options
self._finalize_connector_c(self.with_mysql_capi)
File "/mysql-connector-python-2.1.7/lib/cpy_distutils.py", line 374, in _finalize_connector_c
myc_info = get_mysql_config_info(mysql_config)
File "/mysql-connector-python-2.1.7/lib/cpy_distutils.py", line 226, in get_mysql_config_info
log.debug("# mysqlclient_lib: {0}".format(mysqlclient_libs[-1]))
IndexError: list index out of range