- Python 3.9.4
- Fedora 34 workstation
I want to read data in a mariadb database from a python program.
Environment:
- The Server is a virtual machine using gnome-boxes.
- Guest: Centos 8 Stream
- mariadb version 10.3.27
- Host, fedora 34:
- mariadb version 10.5.9
I have a python virtual environment in host:
mkdir connection && cd connection
python -m venv jarvis
source /jarvis/bin/activate
I trying to install mariadb python connector with the following command:
(jarvis) pip install mariadb
But an error occurred
WARNING: Discarding https://files.pythonhosted.org/packages/94/df/1c0d68f2f24b987b2ecb6d46175132b29da15d60a6c51bc65d4de3bf2f9c/mariadb-0.9.53.tar.gz#sha256=6cefbb3be85b932a491025c4ccfa9024cc98947426fbff6b48129e8142ee9de9 (from https://pypi.org/simple/mariadb/) (requires-python:>=3.6). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached mariadb-0.9.52.tar.gz (72 kB)
ERROR: Command errored out with exit status 1:
command: /home/joe/Documents/python/connector/jarvis-env/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-4jz14rsh/mariadb_c2dcc4da4eb745a9b6788f0f3764994f/setup.py'"'"'; __file__='"'"'/tmp/pip-install-4jz14rsh/mariadb_c2dcc4da4eb745a9b6788f0f3764994f/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-pip-egg-info-1548avr1
cwd: /tmp/pip-install-4jz14rsh/mariadb_c2dcc4da4eb745a9b6788f0f3764994f/
Complete output (12 lines):
/bin/sh: line 1: mariadb_config: command not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-4jz14rsh/mariadb_c2dcc4da4eb745a9b6788f0f3764994f/setup.py", line 24, in <module>
cfg = get_config(options)
File "/tmp/pip-install-4jz14rsh/mariadb_c2dcc4da4eb745a9b6788f0f3764994f/mariadb_posix.py", line 49, in get_config
cc_version = mariadb_config(config_prg, "cc_version")
File "/tmp/pip-install-4jz14rsh/mariadb_c2dcc4da4eb745a9b6788f0f3764994f/mariadb_posix.py", line 26, 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.
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/d9/70/d5048fa20d2cd986181094cc35ccae284f36e80fe61e2821b79d281b03a2/mariadb-0.9.52.tar.gz#sha256=554e7067ea68430fb7c3b4df1be7c9f2ff3ab7bf806c2d9076f959645e7a96de (from https://pypi.org/simple/mariadb/) (requires-python:>=3.6). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement mariadb
ERROR: No matching distribution found for mariadb
WARNING: You are using pip version 21.0.1; however, version 21.1.1 is available.
You should consider upgrading via the '/home/joe/Documents/python/connector/jarvis-env/bin/python -m pip install --upgrade pip' command.
How can we fix that problem and install the mariadb python connector in fedora-34 workstation?