直接执行 pip install mysqlclient 1). 如果报错: OSError: mysql_config not found 那么执行如下,👉参考 sudo apt-get install libmysqlclient-dev 2). 如果报错: ERROR: Failed building wheel for mysqlclient 那么执行如下,其中 x.y 是你的 python 版本。👉参考 sudo apt-get install pythonx.y-dev