libmariadbclient-dev安装错误:取决于:libmariadbclient18

fre*_*eAR 4 mysql mariadb python-3.x

我正在尝试安装mysqclient,但是在具有Python 3.7.0的Ubuntu 18.04 LTS中尝试“ apt-get install libmariadbclient-dev”时遇到错误。

我该如何进行这项工作?谢谢。

sudo apt-get install libmariadbclient-dev
Reading package lists... Done   
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libmariadbclient-dev : Depends: libmariadbclient18 (= 1:10.1.29-6) but 1:10.3.7+maria~bionic is to be installed
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)

fre*_*eAR 5

安装较旧的版本可以:

sudo apt-get install libmariadbclient18=1:10.1.29-6
sudo apt-get install libmariadbclient18-dev=1:10.1.29-6
pip3.7 install mysqlclient
Run Code Online (Sandbox Code Playgroud)

更新2018年7月12日:今天,我按如下所示(在干净的系统中)安装了MariaDB 10.3.8,并在没有抱怨的情况下安装了libmariadbclient18:

sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.3/ubuntu bionic main'
sudo apt update
sudo apt install mariadb-server
sudo apt install mariadb-client
sudo apt install libmariadb-dev
sudo apt install libmariadb-dev-compat
sudo apt-get install libmariadbclient18
Run Code Online (Sandbox Code Playgroud)

我不知道安装libmariadb-dv和libmariadv-dev-compat是否有帮助。

  • 顺便一提。也许不再需要“libmariadbclient-dev”?我安装了:“libmariadb-dev”和“libmariadb-dev-compat”。“compat”包修复了编译期间的“include”错误。我只是在 Makefile 中使用“-lmariadb”。 (2认同)