问题:centos7中安装mysqlclient时候报错:
OSError: mysql_config not found
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
解决方法:
yum install gcc mariadb-devel
pip3 install mysqlclient
补充:
多种mysql驱动
python并没有给出连接mysql的程序实现,所以需要安装第三方的程序包==mysql驱动
进而可以在python中连接mysql
- mysql-connector-python - mysql 官方提供,纯python构建
- PyMySQL - 开源作者methane和adamchainz 提供,纯python构建
- cymysql - fork of pymysql,C构建
- mysqldb 不适用于python3
- mysqlclient - fork of mysqldb 开源作者methane提供,C构建