Score:1

MariaDB Connector/C is not installed

cn flag

I run Ubuntu 22.04.1 and have installed

apt install mariadb-client
apt install python-is-python3
apt install python3-pip

Now I want to install

pip3 install mariadb

and I get this error

testdns:~ # pip3 install mariadb
Collecting mariadb
  Using cached mariadb-1.1.4.zip (97 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [19 lines of output]
      /bin/sh: 1: mariadb_config: not found
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-qky_da14/mariadb_e832618ff3c74f408e9a89ba04e06286/setup.py", line 27, in <module>
          cfg = get_config(options)
        File "/tmp/pip-install-qky_da14/mariadb_e832618ff3c74f408e9a89ba04e06286/mariadb_posix.py", line 62, in get_config
          cc_version = mariadb_config(config_prg, "cc_version")
        File "/tmp/pip-install-qky_da14/mariadb_e832618ff3c74f408e9a89ba04e06286/mariadb_posix.py", line 28, in mariadb_config
          raise EnvironmentError(
      OSError: mariadb_config not found.
      
      This error typically indicates that MariaDB Connector/C, a dependency which
      must be preinstalled, is not found.
      If MariaDB Connector/C is not installed, see installation instructions
      If MariaDB Connector/C is installed, either set the environment variable
      MARIADB_CONFIG or edit the configuration file 'site.cfg' to set the
       'mariadb_config' option to the file location of the mariadb_config utility.
      
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

How to overcome this?

Score:1
es flag

I found this command from Mariadb page

sudo apt install libmariadb3 libmariadb-dev

and it worked for me

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.