网上找了很多方法,都没有解决,最终重新安装了mysqlclient就行了。
pip uninstall mysqlclient pip install mysqlclient --no-cache-dir