Installation environment: OS X Yosemite, Python 2.7.9
The official API MySQLdb is contained in the package MySQL-python. Therefore, when using pip to install the MySQLdb, just simply execute the command in Terminal:pip install MySQL-python.
Solve an error Reason: image not found
After installing the MySQL-python successfully, let’s import this package in the Python to connect to MySQL database. However, an error as follows may occur:
Don’t worry. The solution is easy. Just open the terminal and execute command:
Then re-open your Python and import the package again, I think the problem will probably be solved. Yeah! :)