mariadb_config未找到安装mariadb软件包[重复]

j13ufse2  于 2023-10-20  发布在  其他
关注(0)|答案(4)|浏览(199)

此问题已在此处有答案

Problem with pip install mariadb - mariadb_config not found(5个答案)
昨天关门了。
我尝试在我的ubuntu 20.04上安装mariadb包,我得到这个消息:

Collecting mariadb

Using cached mariadb-1.1.3.tar.gz (80 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-t71j4ld7/mariadb_85318304dde74615894ef8d77544330a/setup.py", line 26, in <module>
          cfg = get_config(options)
        File "/tmp/pip-install-t71j4ld7/mariadb_85318304dde74615894ef8d77544330a/mariadb_posix.py", line 63, in get_config
          cc_version = mariadb_config(config_prg, "cc_version")
        File "/tmp/pip-install-t71j4ld7/mariadb_85318304dde74615894ef8d77544330a/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
      at: https://github.com/mariadb-corporation/mariadb-connector-c/wiki/install.md.
      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.

我找到了很多关于这个主题的主题和答案,比如更新和升级系统,升级我的pip版本或安装libmariadbclient-dev,setuptools或libmysqlclient-dev等软件包。
我也在我的系统上安装了libmariadb-dev,但这些解决方案都不适合我。
python3 --version:Python语言3.8.10
pip --版本:pip 22.1.2
谢谢你的帮助!

wgeznvg7

wgeznvg71#

安装libmariadb-dev是不够的,你还需要安装libmariadb(focal上是libmariadb 3),因为mariadb-config二进制文件不是dev包的一部分。
sudo apt-get install libmariadb3 libmariadb-dev
另一个选择是安装服务器包,其中也包含MariaDB Connector/C。

zed5wv10

zed5wv102#

我在安装termcolor时遇到了同样的问题。解为this site。(我和这个网站没有任何关系。只是浏览了一下。*)。

对我来说,使用

pip install --upgrade setuptools

效果很好。问题是,我使用的是旧版本的setuptools,无法安装最新更新的软件包。

nbnkbykc

nbnkbykc3#

可能的解决方案:升级所有其他软件包,然后安装有问题的软件包。

我在升级Python包时遇到了类似的错误:

pip3 freeze --local | egrep -v '^\-e|@' | cut -d = -f 1  | xargs pip install --user -U --no-deps

但有几个软件包无法安装并抛出错误:
python setup.py egg_info did not run successfully.
所以我从升级中排除了这些包:

pip3 freeze --local | egrep -v '^\-e|@' | cut -d = -f 1 | grep -v atomicwrites | grep -v drep | grep -v gffutils | grep -v hapROH | grep -v pyfaidx | grep -v pygtrie | grep -v python-igraph | grep -v pytools | grep -v rpy2 | grep -v vamb | xargs pip install --user -U --no-deps

升级所有可安装的软件包后,我可以安装问题子程序:

echo -e "atomicwrites\ndrep\ngffutils\nhapROH\npyfaidx\npygtrie\npython-igraph\npytools\nrpy2\nvamb"| xargs pip3 install --user --upgrade --no-deps
cygmwpex

cygmwpex4#

对我来说,它通过安装以下软件包工作:

sudo apt-get install libmariadb3 libmariadb-dev

然后运行此命令:

pip install --upgrade setuptools

相关问题