linux上安装mysqlclient报错的原因 (ERROR: No matching distribution found for mysqlclient)

昨天因为想在linux的centos7上安装mysqclient用来配合django链接数据库,但是,在我安装mysqlclient的时候报错,我当时使用的是pip3 install mysqlclient来安装的,结果gg,当时报的是

ERROR: No matching distribution found for mysqlclient==2.0.3,

很残忍,后来去百度找了一些办法,我的步骤是这样的,首先 安装python3-dev (如何安装自行百度)

第二步,安装mysql-server,但是在我安装的报了一个问题,报出问题的原文是:The GPG keys listed for the "MySQL 5.7 Community Server" repository are already installed but they are not correct for this package.
Check that the correct key URLs are configured for this repository
大意是我的数据库的密钥匹配不正确,这里我就不解释啥叫密钥了哈,自行百度,等于就是说 我的密钥不匹配就不能安装mysql-server,解决方法就是,当我们在安装mysqlserver的时候,需要导入密钥,导入密钥的命令是:rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022。
这时候我们在进行yum install mysql-server,这时候就能正常安装了,当我们安装了mysql-server后,在控制台上打出pip3 install mysqlclient即可正常安装mysqlclient。

学会记得点赞哦

猜你喜欢

转载自blog.csdn.net/m0_58002043/article/details/123246974