Oct 152013
UPDATE 2013-10-16: Macports now has a mysql_select package that cleanly solves this problem. Run the following and then pip will be able to find mysql_config without issue.
sudo port install mysql_select sudo port select mysql mysql56
Using pip to install MySQL-python (aka MySQLdb) gives the error “EnvironmentError: mysql_config not found” when run on a system where MySQL has been installed via MacPorts. The solution is to tell the installer where mysql_config can be found by appending “mysql_config = /opt/local/bin/mysql_config5” to site.cfg. Assuming use of virtualenvwrapper (highly recommended!):
pip install --no-install MySQL-python ... ignore errors ... VENV=$(dirname $(dirname $(which python))); echo "mysql_config = /opt/local/bin/mysql_config5" >> $VENV/build/MySQL-python/site.cfg pip install --no-download MySQL-python
First command should be:
pip install –no-install MySQL-python
instead of:
pip install –no-download MySQL-python
I guess its a typo.
You’re right, thanks for letting me know! Fixed.
That saved my ass, thanks!
Hello, of course this piece of writing is genuinely good and
I have learned lot of things from it on the topic of blogging.
thanks.