问题
I am trying
import MySQLdb as mdb
on PyCharm and get the error:
ImportError: No module named MySQLdb
From the PyCharm-preference, cannot find MySQLdb to import. pymysql was successfully installed on PyCharm though. Suggestions ? Thank you very much.
回答1:
You can use pymysql
installing through PyCharm instead of MySQLdb. It's a drop-in replacement for it.
Documentation: https://github.com/PyMySQL/PyMySQL
来源:https://stackoverflow.com/questions/39499387/pycharm-import-mysql