pip install mysqlclient
OSError: mysql_config not found
File "<string>", line 1, in <module> File "/private/var/folders/qw/y81w55mx5d3gx8rlzy09yvfh0000gn/T/pip-install-h2htc37w/mysqlclient/setup.py", line 16, in <module> metadata, options = get_config() File "/private/var/folders/qw/y81w55mx5d3gx8rlzy09yvfh0000gn/T/pip-install-h2htc37w/mysqlclient/setup_posix.py", line 51, in get_config libs = mysql_config("libs") File "/private/var/folders/qw/y81w55mx5d3gx8rlzy09yvfh0000gn/T/pip-install-h2htc37w/mysqlclient/setup_posix.py", line 29, in mysql_config raise EnvironmentError("%s not found" % (_mysql_config_path,)) OSError: mysql_config not found
Exception: Wrong MySQL configuration: maybe https://bugs.mysql.com/bug.php?id=86971 ?
File "/private/var/folders/qw/y81w55mx5d3gx8rlzy09yvfh0000gn/T/pip-install-s1l5ok5z/mysqlclient/setup_posix.py", line 53, in <listcomp> libraries = [dequote(i[2:]) for i in libs if i.startswith('-l')] File "/private/var/folders/qw/y81w55mx5d3gx8rlzy09yvfh0000gn/T/pip-install-s1l5ok5z/mysqlclient/setup_posix.py", line 12, in dequote raise Exception("Wrong MySQL configuration: maybe https://bugs.mysql.com/bug.php?id=86971 ?") Exception: Wrong MySQL configuration: maybe https://bugs.mysql.com/bug.php?id=86971 ? ----------------------------------------
解决方式:https://github.com/PyMySQL/mysqlclient-python/blob/master/README.md