No module named MySQLdb (python exception)
python导入包MySQLdb异常:
1 |
ImportError: No module named MySQLdb |
解决方案:
Ubuntu 14, Ubuntu 16, Debian 8.6 (jessie):
1 2 |
sudo apt-get install python-pip python-dev libmysqlclient-dev sudo pip install MySQL-python |
Fedora 24:
1 2 |
sudo dnf install python python-devel mysql-devel redhat-rpm-config gcc sudo pip install MySQL-python |
Centos 6, Centos 7:
1 |
yum install MySQL-python -y |
参考:https://stackoverflow.com/questions/25865270/how-to-install-python-mysqldb-module-using-pip