A-A+

No module named MySQLdb (python exception)

2017年01月07日 异常 暂无评论 阅读 45 次

python导入包MySQLdb异常:

ImportError: No module named MySQLdb

解决方案:

Ubuntu 14, Ubuntu 16, Debian 8.6 (jessie):

sudo apt-get install python-pip python-dev libmysqlclient-dev
sudo pip install MySQL-python

Fedora 24:

sudo dnf install python python-devel mysql-devel redhat-rpm-config gcc
sudo pip install MySQL-python

Centos 6, Centos 7:

yum install MySQL-python -y

参考:https://stackoverflow.com/questions/25865270/how-to-install-python-mysqldb-module-using-pip

标签:

给我留言