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

Posted cnhkzyy

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决报错:from err django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module. Did you ins相关的知识,希望对你有一定的参考价值。

前言

使用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》

以上是关于解决报错:from err django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module. Did you ins的主要内容,如果未能解决你的问题,请参考以下文章

django报错:django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module. Did you install

django配置使用mysql数据库运行报错:django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No

django中连接mysql数据库报错“django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is requ

django locale-url import error cannot import name 'urlresolvers' from 'django.core'

django报错系列django.core.exceptions.ImproperlyConfigured

Django启动时找不到mysqlclient处理 django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.