I'm going to connect to mysql database using python. My python version is 2.7.12 and I've installed MySQL using sudo yum install MySQL-python
Package MySQL-python26-1.2.3-11.14.amzn1.x86_64 already installed and latest version
Nothing to do
Linux version:
$ cat /etc/*-release
NAME="Amazon Linux AMI"
VERSION="2016.09"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2016.09"
But when I try to import MySQLdb package it gives an error:
$python
>>> import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named MySQLdb
I've tried different ways as long as I found on the internet but it didn't work.
Any help would be appreciated.
Updated: Required dependency library:
sudo yum install mysql-devel