MySQL-python EnvironmentError: mysql_config not found | InfoEntropy

MySQL-python EnvironmentError: mysql_config not found | InfoEntropy

MySQL-python EnvironmentError: mysql_config not found | InfoEntropy

I’ve been trying to get the Tornado Web Server setup on my Mac OS 10.6 Snow Leopard laptop. There are tons of dependencies it has been a pain in the ass.

Install MySQLdb python driver.

Download latest MySQL_python.

tar xzf MySQL-python-1.2.3c1.tar.gz
cd MySQL-python-1.2.3c1
python setup.py build

Build process may give you an error

EnvironmentError: mysql_config not found

This happens because your mysql installation may be non-standard. Mac OS installations are typically wacky. If you get this error figure out where your mysql_config binary resides.

I found my bin file at /usr/local/mysql/bin/mysql_config

cd MySQL-python-1.2.3c1
vim  site.cfg

In the MySQL-python site.cfg file search for these lines…

# The path to mysql_config.
# Only use this if mysql_config is not on your PATH, or you have some weird
# setup that requires it.
mysql_config = /usr/local/mysql/bin/mysql_config

Replace mysql_config with your path. My executable was in a different place from where the build script thought the executable would be and the mysql_config executable was not in my resource PATH. I have a Mac 10.6 machine and I probably installed MySQL 5 using MacPorts.

Now you should be able to successfully build and install the MySQL for Python library.

python setup.py build
python setup.py install
posted on 2012-02-26 14:57  lexus 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/lexus/archive/2012/02/26/2368661.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值