通过pip3安装MariaDB时收到错误

时间:2020-07-26 03:00:13

标签: pip mariadb

通过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)时,也会发生此错误。

1 个答案:

答案 0 :(得分:2)

我现在能够安装MariaDB 1.0.0连接器,而现在没有任何问题。如果收到操作系统错误,请使用completion(response.result.mapError { $0 as Error } ) 安装mariadbclient-dev软件包,然后可以使用sudo apt-get install libmariadbclient-dev安装。