欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

在ubuntu16.04下安装myqlclient遇到的一系列问题解决方案

程序员文章站 2022-05-29 11:35:17
...

错误1:

/mysqlclient-1.4.2.post1.tar.gz
    ERROR: Complete output from command python setup.py egg_info:
    ERROR: /bin/sh: 1: mysql_config: not found
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-37l4wyqy/mysqlclient/setup.py", line 16, in <module>
        metadata, options = get_config()
      File "/tmp/pip-install-37l4wyqy/mysqlclient/setup_posix.py", line 51, in get_config
        libs = mysql_config("libs")
      File "/tmp/pip-install-37l4wyqy/mysqlclient/setup_posix.py", line 29, in mysql_config
        raise EnvironmentError("%s not found" % (_mysql_config_path,))
    OSError: mysql_config not found
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-37l4wyqy/mysqlclient/

解决方案:

sudo apt install libmysqlclient-dev
pip install mysqlclient

错误2

Failed building wheel for mysqlclient

解决方案:

sudo apt install python3-dev
pip install mysqlclient
相关标签: mysqlclient