我今天尝试在python上安装mysqlclient,但它变得一团糟,给了我这个错误
***raise EnvironmentError("%s not found" % (mysql_config.path,))
OSError: mysql_config not found*** then I tried to edit the mysql.config file by adding
***#Create options
libs="-L$pkglibdir"
libs="$libs -lmysqlclient -lssl -lcrypto"***
但它仍然给我同样的错误。我在Mac版本10.6.8。 错误的详细信息如下:
****Complete output from command python setup.py egg_info:
/bin/sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/s4/s4O4m-85EgGDXYYsUzcvNU+++TQ/-Tmp-/pip-
build-s7w0agk6/mysqlclient/setup.py", line 17, in <module>
metadata, options = get_config()
File "/private/var/folders/s4/s4O4m-85EgGDXYYsUzcvNU+++TQ/-Tmp-/pip-
build-s7w0agk6/mysqlclient/setup_posix.py", line 44, in get_config
libs = mysql_config("libs_r")
File "/private/var/folders/s4/s4O4m-85EgGDXYYsUzcvNU+++TQ/-Tmp-/pip-
build-s7w0agk6/mysqlclient/setup_posix.py", line 26, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
OSError: mysql_config not found****
我真的很感激任何帮助。
答案 0 :(得分:2)
尝试通过终端添加路径:
export PATH=$PATH:/usr/local/mysql/bin
将其永久添加到/etc/paths
文件的末尾。