How to use MySQLdb with Python and Django in OSX 10.6?
I had the same error and
pip install MySQL-python solved it for me.
- If you don't have pip,
easy_install MySQL-pythonshould work.
- If your python is managed by a packaging system, you might have to usethat system (e.g.
sudo apt-get install ...)
Below, Soli notes that if you receive the following error:
EnvironmentError: mysql_config not found
... then you have a further system dependency issue. Solving this will vary from system to system, but for Debian-derived systems:
sudo apt-get install python-mysqldb
Adding to other answers, the following helped me finish the installation mysql-python:
apt-get install libmysqlclient-devapt-get install python-devpip install mysql-python
Don't forget to add 'sudo' to the beginning of commands if you don't have the proper permissions.