Ubuntu18 下 pip install mysqlclient 报错 问题解决方案

今天安装mysqlclient 折腾了会,记录一下,希望可以帮助到遇到相同问题的朋友。

环境:Python 3.6

  1. 首先遇到的报错:Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ezfej8h3/mysqlclient/

Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-ezfej8h3/mysqlclient/

解决方案:
安装 python3.6-dev, libmysqlclient-dev:

  1. 然后又会报如下的错误:
    Failed building wheel for mysqlclient
    > Failed building wheel for mysqlclient

解决方案,来个全家桶:

安装成功:
Success