需要先安装pkg-config和libmysqlclient-dev:

sudo apt-get install pkg-config libmysqlclient-dev

重新尝试安装 mysqlclient

pip install mysqlclient