pycharm mysqldb 报错

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wanglei_storage/article/details/84984674
pycharm 报错:

django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
Did you install mysqlclient?

解决

1、打开pycharm
2、选择 preferences
3、选择 Project Interpreter
4、安装 PyMySQL
5、编辑项目下的__init__.py文件,添加如下内容

import pymysql
pymysql.install_as_MySQLdb()

猜你喜欢

转载自blog.csdn.net/wanglei_storage/article/details/84984674