今天安装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:

sudo apt-get install python3.6-dev libmysqlclient-dev
  1. 然后又会报如下的错误:

    Failed building wheel for mysqlclient

Failed building wheel for mysqlclient

解决方案,来个全家桶:

sudo apt-get install python3 python-dev python3-dev   build-essential libssl-dev libffi-dev  libxml2-dev libxslt1-dev zlib1g-dev  python-pip

安装成功:

Success

ps:如果您有好的建议,欢迎交流 :-D,也欢迎访问我的个人博客:tundrazone.com

文章来源于互联网,如有雷同请联系站长删除:Ubuntu18 下 pip install mysqlclient 报错 问题解决方案

发表评论