Exception: Can not find valid pkg-config name. Specify MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS env vars manually
起初安装发现缺少pkg-config和 MYSQLCLIENT_LDFLAGS环境变量 ,安装和手动声明环境变量后又报新的错
MYSQL_OPT_SSL_ENFORCE
然后看服务器的mysql版本
发现是mariadb 5
但是我们需要的是mysql 8.0
于是把mariadb卸载
rpm -qa | grep mariadb 输出: mariadb-libs-5.5.50-1.el7_2.x86_64 mariadb-5.5.50-1.el7_2.x86_64 mariadb-server-5.5.50-1.el7_2.x86_64 然后执行 # rpm -e --nodeps mariadb-libs-5.5.50-1.el7_2.x86_64 # rpm -e --nodeps mariadb-5.5.50-1.el7_2.x86_64 # rpm -e --nodeps mariadb-server-5.5.50-1.el7_2.x86_64
再装mysql 8.0 和
yum install mysql-devel
再进行装 pip install mysqlclient就可以了
大功告成!
标签:x86,python,50,centos7,client,64,mysql,mariadb,5.5 From: https://www.cnblogs.com/shenwenlong/p/17812685.html