通过pip3安装MariaDB时收到错误[重复]

wnvonmuf  于 2023-10-20  发布在  其他
关注(0)|答案(1)|浏览(174)

此问题已在此处有答案

Python MariaDB pip install failed, missing mariadb_config(4个答案)
三年前就关门了。
我收到一个错误时,通过pip3安装mairadb。下面是命令和错误。

sudo pip3 install mariadb
------------------------------------------------------------------
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting mariadb
  Using cached mariadb-1.0.0.tar.gz (78 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-z5vslgxx/mariadb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-z5vslgxx/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-pip-egg-info-hfv4vge6
         cwd: /tmp/pip-install-z5vslgxx/mariadb/
    Complete output (12 lines):
    /bin/sh: 1: mariadb_config: not found
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-z5vslgxx/mariadb/setup.py", line 26, in <module>
        cfg = get_config(options)
      File "/tmp/pip-install-z5vslgxx/mariadb/mariadb_posix.py", line 49, in get_config
        cc_version = mariadb_config(config_prg, "cc_version")
      File "/tmp/pip-install-z5vslgxx/mariadb/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.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

我已经通过sudo pip3 install --upgrade setuptools更新了pip的setuptools,但没有用。当尝试安装大多数与sql相关的模块时,例如mysql,也会发生此错误。

wh6knrhe

wh6knrhe1#

我现在可以安装MariaDB 1.0.0(及以上)连接器,没有任何问题。如果您收到操作系统错误,请使用sudo apt-get install libmariadb-dev安装mariadbclient-dev软件包,然后您可以使用pip3 install mariadb安装。

相关问题