问题描述
pip3 install mysqlclient报错:src/MySQLdb/_mysql.c:29:19: fatal error: mysql.h: No such file or directory
#include “mysql.h”
^
compilation terminated.
error: command ‘/usr/bin/gcc’ failed with exit code 1
原因分析:
报错信息里提示找不到mysql.h文件
解决方案:
1.添加.h环境变量
export C_INCLUDE_PATH=$C_INCLUDE_PATH:/workspace/project/mysql-5.7.24-linux-glibc2.12-x86_64/include
2.重新安装mysqlclient
pip3 install mysqlclient