首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Python安装失败,缺少MariaDB mariadb_config

Python安装失败,缺少MariaDB mariadb_config
EN

Stack Overflow用户
提问于 2020-06-25 21:58:30
回答 3查看 12.1K关注 0票数 7

我正在使用LinuxUbuntu18.04和python 3,我试图在maria和python脚本之间建立一个连接。因此,我必须安装mariadb软件包。

我已经安装了:

代码语言:javascript
运行
复制
sudo apt install mariadb-server

但当我尝试:

代码语言:javascript
运行
复制
pip install mariadb

我得到以下错误:

代码语言:javascript
运行
复制
Collecting mariadb
  Using cached mariadb-1.0.0.tar.gz (78 kB)

    ERROR: Command errored out with exit status 1:
     command: /home/niklas/Desktop/Stuff/venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pycharm-packaging/mariadb/setup.py'"'"'; __file__='"'"'/tmp/pycharm-packaging/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-wfnscxnz
         cwd: /tmp/pycharm-packaging/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/pycharm-packaging/mariadb/setup.py", line 26, in <module>
        cfg = get_config(options)
      File "/tmp/pycharm-packaging/mariadb/mariadb_posix.py", line 49, in get_config
        cc_version = mariadb_config(config_prg, "cc_version")
      File "/tmp/pycharm-packaging/mariadb/mariadb_posix.py", line 27, in mariadb_config
        "mariadb_config not found.\nPlease make sure, that MariaDB Connector/C is installed on your system, edit the configuration file 'site.cfg' and set the 'mariadb_config'\noption, which should point to the mariadb_config utility.")
    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.

有人能帮我吗?

编辑:

我现在已经能够连接到服务器,但没有使用te mariadb包。(pymysql/)

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2020-07-09 16:31:07

要安装mariadb模块,必须安装最新版本的MariaDB连接器/C,最低要求版本为3.1.5,AFAIKUbuntu18.04有3.0.3。

MariaDB连接器/C下载页面上有一个用于仿生的连接器/C的实际版本。

如果要将其安装在特定目录中,请确保路径和LD_LIBRARY_PATH指向bin和lib目录。

我还建议使用最新版本的MariaDB服务器,特别是在MariaDB服务器上使用非常快速的executemany()方法要慢得多。

票数 7
EN

Stack Overflow用户

发布于 2020-10-08 03:41:45

安装MariaDB连接器/C,这是一个依赖项。

代码语言:javascript
运行
复制
sudo apt-get install libmariadb3 libmariadb-dev

使用PIP安装MariaDB连接器/Python。

代码语言:javascript
运行
复制
pip3 install mariadb
票数 27
EN

Stack Overflow用户

发布于 2020-06-25 22:05:33

似乎你需要先在你的操作系统上安装它。您可以按照这个指南正确地安装它。

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62584959

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档