解决报错:from err django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module. Did you install mysqlclient?

前言

使用python manage.py makemigrations时出现报错:
from err django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module. Did you install mysqlclient?

解决办法

安装pymysql

pip install pymysql

在__init__.py中加入如下代码

import pymysql

pymysql.install_as_MySQLdb()

参考文章

《django安装了pymysql还报MySQLdb module: No module named》

猜你喜欢

转载自www.cnblogs.com/my_captain/p/13192502.html
今日推荐