当前位置:首页 » Python技术

[Mac pro]mysql_config not found

2015-03-14 14:53 本站整理 浏览(15)

A quick and easy way for Mac OS X 10.8 and 10.9: I assume you have XCode, it's command line tool, Python and MySQL installed.

Install PIP:

sudo easy_install pip
Edit ~/.profile:

nano ~/.profile
Copy and paste the following two line
export PATH=/usr/local/mysql/bin:$PATH
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/
Save and exit. Afterwords execute the following command

source  ~/.profile
Install MySQLdb

sudo pip install MySQL-python
To test if everything works fine just try
python -c "import MySQLdb