0
votes

I had mysql (in python) running in my laptop but after Yosemite was updated it stopped running. I uninstall and install mysql again.

pip install MySQL-python

added it to path:

export DYLD_LIBRARY_PATH=/usr/local/mysql/lib:$DYLD_LIBRARY_PATH

But still it doesn't work.

import MySQLdb as mysql ImportError: No module named MySQLdb

1
what python version are you using 2.7 or 3.x? MySQLdb does not support Python 3 - wgitscht
Try doing sudo pip install. If that doesn't work, do xcode-select --install and then do sudo pip install - ytpillai
PyMysql is the best alternative - ytpillai

1 Answers

0
votes

In case you get the error that Visual Studio is not installed on windows, you need to install precompiled MySQL-python from https://pypi.python.org/pypi/MySQL-python/1.2.5