在使用Ubuntu安装mysqlclient报错,安装指令 pip3 install mysqlclient。
Collecting mysqlclient
Using cached https://files.pythonhosted.org/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.tar.gz
Complete output from command python setup.py egg_info:
/bin/sh: 1: mysql_config: not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-8139q6vm/mysqlclient/setup.py", line 16, in <module>
metadata, options = get_config()
File "/tmp/pip-build-8139q6vm/mysqlclient/setup_posix.py", line 51, in get_config
libs = mysql_config("libs")
File "/tmp/pip-build-8139q6vm/mysqlclient/setup_posix.py", line 29, in mysql_config
raise EnvironmentError("%s not found" % (_mysql_config_path,))
OSError: mysql_config not found
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-8139q6vm/mysqlclient/
sudo apt-get install libmysqlclient-dev
pip3 install mysqlclient