System: mac OS 10.12.1
python 2.7.10
Using pip and SourceForge to download and install two methods to install python_MySQLdb, both error reports
Error: EnvironmentError: mysql_config not found
Follow http:/ /blog.csdn.net/janroneh... The modification did not solve the problem and still reported the same error
First you need to install the mysql development library file, a package like libmysqld-dev
Use pymysql. I use pymysql on mac. It is easy to install and easy to use.
brew install mysql
pip install mysqlclient
or pip install MySQL-Python
(Note: mysqlclient is a branch of python mysqldb, already supports python3, and the MySQLdb interface is the same)