如何通过pip安装MySQL python?
我最近升级到Mavericks,现在我的软件包和依赖项都没有运行。 我成功地通过python ez_setup.py安装了pip,我从这里找到了Can't install via pip because of egg_info error
但仍然会收到此错误。
Downloading MySQL-python-1.2.5.zip (108kB): 108kB downloaded
Running setup.py (path:/private/tmp/pip_build_root/MySQL-python/setup.py) egg_info for package MySQL-python
sh: mysql_config: command not found
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/private/tmp/pip_build_root/MySQL-python/setup.py", line 17, in <module>
metadata, options = get_config()
File "setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "setup_posix.py", line 25, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
Complete output from command python setup.py egg_info:
sh: mysql_config: command not found
Traceback (most recent call last):
Command python setup.py egg_info failed with error code 1 in /private/var/folders/xl/lsdkfj09485039845/T/pip_build_Name/mysql-python
Storing debug log for failure in /Users/Name/Library/Logs/pip.log
我也尝试过运行命令行;我在这里找到了export path命令。
https://stackoverflow.com/questions/5178292/pip-install-mysql-python-fails-with-environmenterror-mysql-config-not-found
答案 0 :(得分:0)
下载此处找到的shell脚本 http://www.macminivault.com/mysql-mavericks/
将内容复制并粘贴到名为mine fixeverything.sh
然后从终端运行sh fixeverything.sh
然后我运行此命令链接mysql
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib