惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
The Register - Security
The Register - Security
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Hacker News
The Hacker News
P
Proofpoint News Feed
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
The Last Watchdog
The Last Watchdog
F
Fortinet All Blogs
S
Schneier on Security
Help Net Security
Help Net Security
Security Archives - TechRepublic
Security Archives - TechRepublic
C
Check Point Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Proofpoint News Feed
I
InfoQ
T
The Blog of Author Tim Ferriss
Cisco Talos Blog
Cisco Talos Blog
Stack Overflow Blog
Stack Overflow Blog
T
Troy Hunt's Blog
人人都是产品经理
人人都是产品经理
T
Threatpost
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cyber Attacks, Cyber Crime and Cyber Security
雷峰网
雷峰网
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
爱范儿
爱范儿
Forbes - Security
Forbes - Security
Vercel News
Vercel News
S
Security Affairs
美团技术团队
P
Privacy & Cybersecurity Law Blog
N
News and Events Feed by Topic
Cyberwarzone
Cyberwarzone
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Jina AI
Jina AI
Spread Privacy
Spread Privacy
Attack and Defense Labs
Attack and Defense Labs
IT之家
IT之家
U
Unit 42
Recorded Future
Recorded Future
W
WeLiveSecurity
PCI Perspectives
PCI Perspectives
P
Palo Alto Networks Blog
H
Hacker News: Front Page
S
Security @ Cisco Blogs
博客园 - 【当耐特】

博客园 - 哈喽哈喽111111

RockyLinux SSH 跳板转发 3389(Windows 远程桌面)完整方案 MySQL使用自带的logrotate配置日志轮转 yum方式安装redis7 nacos新加用户操作 网络运营商禁止端口信息 Linux开机启动rc.local不生效的一般解决方案 Nginx流量拷贝ngx_http_mirror_module模块使用方法详解 Adobe 修改 hosts 文件 axios 投毒与好莱坞式骗术 Linux系统在使用systemctl启动服务的失败,报错如下:Error No space left on device git submodule 的增、查、改、删 Rocky Linux 安装 Google Chrome 浏览器 “头号玩家”—— 美国技术霸权下的全球虚拟货币资产收割行动深层解析 你是第几级 AI 编程 MySQL中通过关联update将一张表的一个字段更新到另外一张表中 Linux 的 Port Knocking 端口碰撞(端口敲门) MySQL解除死锁 jar文件解压缩操作 设置Windows服务器远程桌面能使用多个桌面 20251024- 使用shell脚本分库定时备份MySQL数据 禁用sentinel 在 Linux 中安装和配置 NTP 服务器和 NTP 客户端 springboot配置文件关系及加载顺序 用自带的Nginx为gitlab做白名单 在Spring Boot Admin中根据Nacos的命名空间来区分和管理不同的环境
Rocky9和Ubuntu使用pip安装python的库mysqlclient失败解决方式
哈喽哈喽111111 · 2025-09-09 · via 博客园 - 哈喽哈喽111111
# Rocky9

直接使用pip安装mysqlclient会出现缺少依赖,需要先安装mysql-devel相关依赖。

由于rocky9用MariaDB替代了MySQL,所以我们可以通过安装mariadb-devel来安装所需要的依赖。

如果Rocky9已经开启了powertool repo可以直接使用下面命令安装

dnf install mariadb-devel

    或用这个安装/卸载

    // dnf install mysql-devel
    // dnf remove mysql-devel

如果提示如下则说明没有开启,一些包会找不到:

    Error: Unable to find a match: mariadb-devel

没开启的情况可以使用如下命令安装:

dnf install mariadb-devel --enablerepo=devel

安装完之后再进行pip install mysqlclient即可

PS:如果出现GPG key错误,如下:

    Error: GPG check FAILED

这种情况是GPG key没有验证通过,我们可以使用参数 --nogpgcheck 尝试不验证key安装

dnf install mariadb-devel --enablerepo=devel --nogpgcheck

# Ubuntu

安装如下依赖

apt-get install pkg-config python3-dev default-libmysqlclient-dev build-essential

在进行pip安装即可


Rocky9安装mysqlclient

pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/

安装时报错
Specify MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS env vars manually

dnf install -y python3-devel mysql-devel

No match for argument: mysql-devel

wget https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm

rpm -ivh mysql80-community-release-el8-1.noarch.rpm

dnf install -y python3-devel mysql-devel

GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing ‘dnf clean packages’.

vim  /etc/yum.repos.d/mysql-community.repo
gpgcheck=0 #将里面所有check=1改为0

最后

dnf install -y python3-devel mysql-devel
pip install -r requirements.txt -i  https://pypi.tuna.tsinghua.edu.cn/simple/