Apr 30, 2018

How to install mysql-python on Linux

For RPM based:

$ sudo yum -y install MySQL-python

For Ubuntu:

Install pip and upgrade to the latest version:

$ sudo apt install python-pip
$ sudo pip install -U pip

Next, install the required development packages:

$ sudo apt install python-dev libmysqlclient-dev

then

$ sudo pip install MySQL-python