PyCharm import MySQL

╄→尐↘猪︶ㄣ 提交于 2019-12-10 19:19:27

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!