centos 安裝mysqlclient

出現:OSError: mysql_config not found

於是執行:yum install mysql-devel gcc gcc-devel python-devel

卻出現:Failed to download metadata for repo ‘appstream’: Cannot prepare internal mirrorlist: No URLs in mirrorlist

解決方案:CentOs Linux 8 从 2021.10.31 号后已经停止维护,所以之后更新镜像需要通过 vault.centos.org来获取更新

cd /etc/yum.repos.d/

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*

sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

解決!!!

接著執行:yum install mysql-devel gcc

安裝成功

執行:pip install mysqlclient

成功安裝!!!

安裝 django-simple-captcha 錯誤:

The headers or library files could not be found for jpeg

解決方案:yum -y install libjpeg-turbo-devel
 

你可能感兴趣的:(centos,linux,mysql)