No module named MYSQLdb 問題解決

lizhiqiang666發表於2019-01-09

問題描述:

報錯:ImportError: No module named MySQLdb

對於不同的系統和程式有如下的解決方法:

easy_install mysql-python (mix os)
pip install mysql-python (mix os)
apt-get install python-mysqldb (Linux Ubuntu)
cd/usr/ports/databases/py-MySQLdb && make install clean (FreeBSD)
yum install MySQL-python (linux Fedora, CentOS)
pip install mysqlclient (Windows)

更多內容請參考下面的這兩個連結:

http://stackoverflow.com/questions/454854/no-module-named-mysqldb

http://stackoverflow.com/questions/21440230/install-mysql-python-windows

相關文章