Ubuntu 下安装mysqlclient报错
pip3 install mysqlclient 报错信息
问题描述:
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-6z33hc2x/mysqlclient/setup.py", line 16, in <module>
metadata, options = get_config()
File "/tmp/pip-build-6z33hc2x/mysqlclient/setup_posix.py", line 53, in get_config
libs = mysql_config("libs_r")
File "/tmp/pip-build-6z33hc2x/mysqlclient/setup_posix.py", line 28, 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-6z33hc2x/mysqlclient/
解决方法:
sudo apt-get install libmysqlclient-dev
再次安装:
pip3 install mysqlclient