How can I install the MySQLdb module for Python using pip?
It's easy to do, but hard to remember the correct spelling:
pip install mysqlclient
If you need 1.2.x versions (legacy Python only), use pip install MySQL-python
Note: Some dependencies might have to be in place when running the above command. Some hints on how to install these on various platforms:
sudo apt-get install python-pip python-dev libmysqlclient-dev
sudo dnf install python python-devel mysql-devel redhat-rpm-config gcc
brew install mysql-connector-c
if that fails, try
brew install mysql