Mariadb python connector

I am ok using the mysql connector for python, “sudo yum install -y mysql-connector-python*”.
But just wondering, when I try to install the mariadb connector, it fails. Should I do something different to make that work since I am actually using mariadb? Or just be satisfied with the mysql connector?

pip install mariadb
Collecting mariadb
  Using cached https://files.pythonhosted.org/packages/15/73/250a30543f9987af2e3f7856f29917fa22580cd6b457b8e2df0d6d80b3f3/mariadb-1.0.1.tar.gz
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-4vpdsiz7/mariadb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-4vpdsiz7/mariadb/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-4vpdsiz7/mariadb/pip-egg-info
         cwd: /tmp/pip-install-4vpdsiz7/mariadb/
    Complete output (12 lines):
    /bin/sh: mariadb_config: command not found
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-4vpdsiz7/mariadb/setup.py", line 26, in <module>
        cfg = get_config(options)
      File "/tmp/pip-install-4vpdsiz7/mariadb/mariadb_posix.py", line 51, in get_config
        cc_version = mariadb_config(config_prg, "cc_version")
      File "/tmp/pip-install-4vpdsiz7/mariadb/mariadb_posix.py", line 28, in mariadb_config
        raise EnvironmentError(
    OSError: mariadb_config not found.
    Please make sure, that MariaDB Connector/C is installed on your system, edit the configuration file 'site.cfg' and set the 'mariadb_config'
    option, which should point to the mariadb_config utility.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
1 Like

This command is provided by mariadb-connector-c-devel

$ sudo dnf provides mariadb_config
Last metadata expiration check: 0:08:14 ago on Fri 11 Sep 2020 09:07:47 AM CEST.
mariadb-connector-c-devel-3.1.9-5.fc33.i686 : Development files for mariadb-connector-c
Repo        : fedora
Matched from:
Filename    : /usr/bin/mariadb_config

mariadb-connector-c-devel-3.1.9-5.fc33.x86_64 : Development files for mariadb-connector-c
Repo        : fedora
Matched from:
Filename    : /usr/bin/mariadb_config
2 Likes

Thank you. That worked. I didn’t know I would need to install a development package to subsequently install the python connector. I searched and searched and could not find that documented anywhere.
BR,
Ralph

1 Like

It is documented in the error message :sweat_smile:

The workflow is then to search for the mentioned command in which rpm package you can find it (dnf provides) and install it.

Oh but the MariaDB Connector C was installed; I checked by trying to install it and it said it was already installed. What I did not have was the “_devel” package. That was my confusion…

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.